infinitode.py 1.1.1__tar.gz → 1.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: infinitode.py
3
- Version: 1.1.1
3
+ Version: 1.1.2
4
4
  Summary: A python wrapper for the Infinitode 2 API.
5
5
  Home-page: https://github.com/Sprylos/infinitode.py
6
6
  Author: Sprylos
7
7
  License: MIT
8
8
  Platform: UNKNOWN
9
9
  Description-Content-Type: text/markdown
10
- License-File: LICENSE
11
10
 
12
11
  # Infinitode.py
13
12
 
@@ -7,7 +7,7 @@ An asynchronous wrapper for the Infinitode API.
7
7
 
8
8
  __author__ = "Sprylos"
9
9
  __title__ = "infinitode.py"
10
- __version__ = "1.1.1"
10
+ __version__ = "1.1.2"
11
11
  __license__ = """MIT License
12
12
 
13
13
  Copyright (c) 2024 Sprylos
@@ -15,6 +15,9 @@ if TYPE_CHECKING:
15
15
  __all__ = ("Player",)
16
16
 
17
17
 
18
+ AVATAR_URL = "https://storage.prineside.com/files/i2{}/avatars/{}-128.png"
19
+
20
+
18
21
  class Player:
19
22
  """Represents an in-game Player."""
20
23
 
@@ -163,7 +166,7 @@ class Player:
163
166
  @property
164
167
  def avatar_link(self):
165
168
  """The link to the player's avatar. Invalid URL if the user doesn't have a pfp."""
166
- return f"https://{'beta.' if self._beta else ''}infinitode.prineside.com/img/avatars/{self._playerid}-128.png"
169
+ return AVATAR_URL.format('beta' if self._beta else '', self._playerid)
167
170
 
168
171
  @property
169
172
  def daily_quest(self):
@@ -210,21 +213,24 @@ class Player:
210
213
  Fetches the player's Daily Quest score if it wasn't fetched already.
211
214
  Returns None if the player is not ranked.
212
215
  """
213
- if not self._daily_quest: # None or MISSING
214
- if session is None:
215
- if self._daily_quest is MISSING:
216
- raise InfinitodeError(
217
- "You need to provide a Session to fetch the daily quest score."
218
- )
219
- else:
220
- return self._daily_quest
221
-
222
- self._daily_quest = (
223
- await session.daily_quest_leaderboards(playerid=self._playerid, beta=self._beta)
224
- ).player
216
+ if self._daily_quest:
217
+ return self._daily_quest
218
+
219
+ if session is None:
220
+ if self._daily_quest is None:
221
+ return
222
+
223
+ # daily_quest is MISSING
224
+ raise InfinitodeError(
225
+ "You need to provide a Session to fetch the daily quest score."
226
+ )
227
+
228
+ lb = await session.daily_quest_leaderboards(playerid=self._playerid, beta=self._beta)
229
+ self._daily_quest = lb.player
225
230
 
226
231
  return self._daily_quest
227
232
 
233
+
228
234
  async def fetch_skill_point(
229
235
  self, session: Optional[Session] = None
230
236
  ) -> Optional[Score]:
@@ -232,21 +238,24 @@ class Player:
232
238
  Fetches the player's Skill Point score if it wasn't fetched already.
233
239
  Returns None if the player is not ranked.
234
240
  """
235
- if not self._skill_point: # None or MISSING
236
- if session is None:
237
- if self._skill_point is MISSING:
238
- raise InfinitodeError(
239
- "You need to provide a Session to fetch the skill point score."
240
- )
241
- else:
242
- return self._skill_point
243
-
244
- self._skill_point = (
245
- await session.skill_point_leaderboard(playerid=self._playerid, beta=self._beta)
246
- ).player
241
+ if self._skill_point:
242
+ return self._skill_point
243
+
244
+ if session is None:
245
+ if self._skill_point is None:
246
+ return
247
+
248
+ # skill_point is MISSING
249
+ raise InfinitodeError(
250
+ "You need to provide a Session to fetch the skill point score."
251
+ )
252
+
253
+ lb = await session.skill_point_leaderboard( playerid=self._playerid, beta=self._beta)
254
+ self._skill_point = lb.player
247
255
 
248
256
  return self._skill_point
249
257
 
258
+
250
259
  # magic methods
251
260
 
252
261
  def __repr__(self) -> str:
@@ -1,13 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: infinitode.py
3
- Version: 1.1.1
3
+ Version: 1.1.2
4
4
  Summary: A python wrapper for the Infinitode 2 API.
5
5
  Home-page: https://github.com/Sprylos/infinitode.py
6
6
  Author: Sprylos
7
7
  License: MIT
8
8
  Platform: UNKNOWN
9
9
  Description-Content-Type: text/markdown
10
- License-File: LICENSE
11
10
 
12
11
  # Infinitode.py
13
12
 
@@ -1,4 +1,3 @@
1
- LICENSE
2
1
  README.md
3
2
  setup.py
4
3
  infinitode/__init__.py
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2015-present Rapptz
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a
6
- copy of this software and associated documentation files (the "Software"),
7
- to deal in the Software without restriction, including without limitation
8
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
9
- and/or sell copies of the Software, and to permit persons to whom the
10
- Software is furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21
- DEALINGS IN THE SOFTWARE.
File without changes
File without changes
File without changes