Skip to content

Commit 5840ce6

Browse files
committed
project is now conform to ruff linter and ty type checker
1 parent 12cf9a2 commit 5840ce6

2 files changed

Lines changed: 44 additions & 13 deletions

File tree

brawlpy/__init__.py

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,37 @@
88

99
from .API import API
1010
from .main import Client
11-
from .objects import *
11+
from .objects import (
12+
Player,
13+
Club,
14+
ClubMember,
15+
ClubRanking,
16+
PlayerRanking,
17+
BrawlerRanking,
18+
Event,
19+
Brawler,
20+
PlayerBrawler,
21+
Gadget,
22+
StarPower,
23+
Gear,
24+
)
25+
26+
__all__ = [
27+
"API",
28+
"Client",
29+
"Player",
30+
"Club",
31+
"ClubMember",
32+
"ClubRanking",
33+
"PlayerRanking",
34+
"BrawlerRanking",
35+
"Event",
36+
"Brawler",
37+
"PlayerBrawler",
38+
"Gadget",
39+
"StarPower",
40+
"Gear",
41+
]
1242

1343
__title__ = "brawlpy"
1444
__author__ = "PyStarr"

brawlpy/main.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ async def get_player(self, tag):
139139
elif status == 429:
140140
raise RateLimitError(status, url)
141141
elif status == 500:
142-
raise UnexpectedError(status, url)
142+
raise UnexpectedError(status, url, "")
143143
elif status == 503:
144144
raise ServerError(status, url)
145145

@@ -160,7 +160,7 @@ async def get_battle_log(self, tag):
160160
elif status == 429:
161161
raise RateLimitError(status, url)
162162
elif status == 500:
163-
raise UnexpectedError(status, url)
163+
raise UnexpectedError(status, url, "")
164164
elif status == 503:
165165
raise ServerError(status, url)
166166

@@ -243,7 +243,7 @@ async def brawlers(self):
243243
elif status == 429:
244244
raise RateLimitError(status, url)
245245
elif status == 500:
246-
raise UnexpectedError(status, url)
246+
raise UnexpectedError(status, url, "")
247247
elif status == 503:
248248
raise ServerError(status, url)
249249

@@ -255,20 +255,20 @@ async def events(self):
255255
events, status = await self.request(url)
256256

257257
if 300 > status >= 200:
258-
List = []
258+
event_list = []
259259

260260
for each in events:
261-
l = Event(
261+
event = Event(
262262
each["event"]["id"],
263263
each["event"]["mode"],
264264
each["event"]["map"],
265265
each["startTime"],
266266
each["endTime"],
267267
)
268268

269-
List.append(l)
269+
event_list.append(event)
270270

271-
return List
271+
return event_list
272272

273273
elif status == 403:
274274
raise Forbidden(status, url, events["message"])
@@ -277,7 +277,7 @@ async def events(self):
277277
elif status == 429:
278278
raise RateLimitError(status, url)
279279
elif status == 500:
280-
raise UnexpectedError(status, url)
280+
raise UnexpectedError(status, url, "")
281281
elif status == 503:
282282
raise ServerError(status, url)
283283

@@ -322,7 +322,7 @@ async def get_players_rankings(self, countryCode="global", limit=None):
322322
elif status == 429:
323323
raise RateLimitError(status, url)
324324
elif status == 500:
325-
raise UnexpectedError(status, url)
325+
raise UnexpectedError(status, url, "")
326326
elif status == 503:
327327
raise ServerError(status, url)
328328

@@ -350,6 +350,7 @@ async def get_brawlers_rankings(self, brawlerID, countryCode="global", limit=Non
350350
cl = cl["name"]
351351
rankgs.append(
352352
BrawlerRanking(
353+
"",
353354
each["tag"],
354355
each["name"],
355356
each["nameColor"],
@@ -369,7 +370,7 @@ async def get_brawlers_rankings(self, brawlerID, countryCode="global", limit=Non
369370
elif status == 429:
370371
raise RateLimitError(status, url)
371372
elif status == 500:
372-
raise UnexpectedError(status, url)
373+
raise UnexpectedError(status, url, "")
373374
elif status == 503:
374375
raise ServerError(status, url)
375376

@@ -407,7 +408,7 @@ async def get_club_rankings(self, countryCode="global", limit=None):
407408
elif status == 429:
408409
raise RateLimitError(status, url)
409410
elif status == 500:
410-
raise UnexpectedError(status, url)
411+
raise UnexpectedError(status, url, "")
411412
elif status == 503:
412413
raise ServerError(status, url)
413414

@@ -442,7 +443,7 @@ async def get_club_members(self, clubTag):
442443
elif status == 429:
443444
raise RateLimitError(status, url)
444445
elif status == 500:
445-
raise UnexpectedError(status, url)
446+
raise UnexpectedError(status, url, "")
446447
elif status == 503:
447448
raise ServerError(status, url)
448449

0 commit comments

Comments
 (0)