Skip to content

Commit

Permalink
🔀: merge pull request #42 from frissyn/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
frissyn authored Jul 18, 2022
2 parents 6a0b71e + c1a991c commit c79581a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion valorant/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Version(t.NamedTuple):
release: t.Literal["alpha", "beta", "dev"]


version_info = Version(major=1, minor=0, micro=3, release="")
version_info = Version(major=1, minor=0, micro=4, release="")

tag = f"-{version_info.release}" if version_info.release else ""
__version__ = ".".join(str(i) for i in version_info[:3]) + tag
8 changes: 3 additions & 5 deletions valorant/caller.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,17 @@ def call(
self,
m: t.Text,
ep: t.Text,
escape_if: t.Tuple[int] = (),
escape_if: t.Tuple[int, ...] = (),
params: t.Optional[t.Mapping] = None,
route: t.Optional[t.Text] = False,
**kw,
) -> t.Optional[t.Mapping[str, t.Any]]:
prefix = self.base.format(root=self.route if route else self.region)
prefix = self.base.format(root=route if route else self.region)
url = prefix + self.eps[ep].format(**kw)

r = self.sess.request(m, url, params=params)

if r.status_code in escape_if:
return None

r.raise_for_status()

return r.json()
return r.raise_for_status() or r.json()
4 changes: 2 additions & 2 deletions valorant/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def get_user(
"""

r = self.handle.call(
"GET", "puuid", route=True, puuid=puuid, escape_if=(400, 404)
"GET", "puuid", route=route, puuid=puuid, escape_if=(400, 404)
)

return AccountDTO(r, self.handle) if r else None
Expand All @@ -383,7 +383,7 @@ def get_user_by_name(
r = self.handle.call(
"GET",
"game-name",
route=True,
route=route,
name=vals[0],
tag=vals[1],
escape_if=(400, 404),
Expand Down
13 changes: 9 additions & 4 deletions valorant/lexicon.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ def __init__(self):

RANKS = {
0: "Unrated",
1: "Unused1",
2: "Unused2",
3: "Iron 1",
4: "Iron 2",
5: "Iron 3",
Expand All @@ -121,9 +123,12 @@ def __init__(self):
18: "Diamond 1",
19: "Diamond 2",
20: "Diamond 3",
21: "Immortal 1",
22: "Immortal 2",
23: "Immortal 3",
24: "Radiant",
21: "Ascendant 1",
22: "Ascendant 2",
23: "Ascendant 3",
24: "Immortal 1",
25: "Immortal 2",
26: "Immortal 3",
27: "Radiant",
}
"""Mapping of competitiveTier values to rank title."""

0 comments on commit c79581a

Please sign in to comment.