Skip to content

Commit d845a57

Browse files
committed
Made tuples git-friendly
1 parent db7469e commit d845a57

File tree

8 files changed

+125
-24
lines changed

8 files changed

+125
-24
lines changed

tibiapy/character.py

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,28 @@ class Character(abc.BaseCharacter):
145145
Other characters in the same account.
146146
It will be empty if the character is hidden, otherwise, it will contain at least the character itself.
147147
"""
148-
__slots__ = ("former_names", "sex", "vocation", "level", "achievement_points", "world", "former_world", "residence",
149-
"married_to", "house", "guild_membership", "last_login", "account_status", "position", "comment",
150-
"achievements", "deaths", "account_information", "other_characters", "deletion_date")
148+
__slots__ = (
149+
"former_names",
150+
"sex",
151+
"vocation",
152+
"level",
153+
"achievement_points",
154+
"world",
155+
"former_world",
156+
"residence",
157+
"married_to",
158+
"house",
159+
"guild_membership",
160+
"last_login",
161+
"account_status",
162+
"position",
163+
"comment",
164+
"achievements",
165+
"deaths",
166+
"account_information",
167+
"other_characters",
168+
"deletion_date",
169+
)
151170

152171
def __init__(self, name=None, world=None, vocation=None, level=0, sex=None, **kwargs):
153172
self.name = name # type: str
@@ -604,7 +623,12 @@ class Death(abc.Serializable):
604623
time: :class:`datetime.datetime`
605624
The time at which the death occurred.
606625
"""
607-
__slots__ = ("level", "killers", "time", "assists", "name")
626+
__slots__ = (
627+
"level",
628+
"killers",
629+
"time",
630+
"assists",
631+
"name")
608632

609633
def __init__(self, name=None, level=0, **kwargs):
610634
self.name = name
@@ -652,7 +676,9 @@ class GuildMembership(abc.BaseGuild):
652676
rank: :class:`str`
653677
The name of the rank the member has.
654678
"""
655-
__slots__ = ("rank",)
679+
__slots__ = (
680+
"rank",
681+
)
656682

657683
def __init__(self, name, rank):
658684
self.name = name # type: str
@@ -681,7 +707,11 @@ class Killer(abc.Serializable):
681707
summon: :class:`str`, optional
682708
The name of the summoned creature, if applicable.
683709
"""
684-
__slots__ = ("name", "player", "summon")
710+
__slots__ = (
711+
"name",
712+
"player",
713+
"summon"
714+
)
685715

686716
def __init__(self, name, player=False, summon=None):
687717
self.name = name # type: str
@@ -726,7 +756,11 @@ class OnlineCharacter(abc.BaseCharacter):
726756
level: :class:`int`
727757
The level of the character.
728758
"""
729-
__slots__ = ("world", "vocation", "level")
759+
__slots__ = (
760+
"world",
761+
"vocation",
762+
"level",
763+
)
730764

731765
def __init__(self, name, world, level, vocation):
732766
self.name = name # type: str
@@ -750,7 +784,11 @@ class OtherCharacter(abc.BaseCharacter):
750784
deleted: :class:`bool`
751785
Whether the character is scheduled for deletion or not.
752786
"""
753-
__slots__ = ("world", "online", "deleted")
787+
__slots__ = (
788+
"world",
789+
"online",
790+
"deleted"
791+
)
754792

755793
def __init__(self, name, world, online=False, deleted=False):
756794
self.name = name # type: str

tibiapy/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
from tibiapy import Character, Guild, World, House, KillStatistics, ListedGuild, Highscores, Category, VocationFilter, \
88
ListedHouse, HouseType, WorldOverview, NewsCategory, NewsType, ListedNews, News, Forbidden, NetworkError
99

10-
__all__ = ("Client",)
10+
__all__ = (
11+
"Client",
12+
)
1113

1214

1315
class Client:

tibiapy/guild.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@
1212
from tibiapy.utils import parse_json, parse_tibia_date, parse_tibiacom_content, parse_tibiadata_date, try_date, \
1313
try_datetime, try_enum
1414

15-
__all__ = ("Guild", "GuildMember", "GuildInvite", "ListedGuild")
15+
__all__ = (
16+
"Guild",
17+
"GuildMember",
18+
"GuildInvite",
19+
"ListedGuild",
20+
)
1621

1722
COLS_INVITED_MEMBER = 2
1823
COLS_GUILD_MEMBER = 6

tibiapy/highscores.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77
from tibiapy import Category, InvalidContent, Vocation, VocationFilter, abc
88
from tibiapy.utils import parse_json, parse_tibiacom_content, try_enum
99

10-
__all__ = ("ExpHighscoresEntry", "Highscores", "HighscoresEntry", "LoyaltyHighscoresEntry")
10+
__all__ = (
11+
"ExpHighscoresEntry",
12+
"Highscores",
13+
"HighscoresEntry",
14+
"LoyaltyHighscoresEntry",
15+
)
1116

1217
results_pattern = re.compile(r'Results: (\d+)')
1318

@@ -48,7 +53,7 @@ def __init__(self, world, category, **kwargs):
4853
'categroy',
4954
'vocation',
5055
'entries',
51-
'results_count'
56+
'results_count',
5257
)
5358

5459
def __repr__(self):

tibiapy/house.py

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
99
from tibiapy.utils import parse_json, parse_number_words, parse_tibia_datetime, parse_tibiacom_content, try_date, \
1010
try_datetime, try_enum, parse_tibia_money
1111

12-
__all__ = ("House", "CharacterHouse", "GuildHouse", "ListedHouse")
12+
__all__ = (
13+
"House",
14+
"CharacterHouse",
15+
"GuildHouse",
16+
"ListedHouse",
17+
)
1318

1419
id_regex = re.compile(r'house_(\d+)\.')
1520
bed_regex = re.compile(r'This (?P<type>\w+) has (?P<beds>[\w-]+) bed')
@@ -74,9 +79,23 @@ class House(abc.BaseHouseWithId):
7479
auction_end: :class:`datetime.datetime`, optional
7580
The date when the auction will end.
7681
"""
77-
__slots__ = ("image_url", "beds", "type", "size", "rent", "owner", "owner_sex", "paid_until", "transfer_date",
78-
"transferee", "transfer_price", "transfer_accepted", "highest_bid",
79-
"highest_bidder", "auction_end")
82+
__slots__ = (
83+
"image_url",
84+
"beds",
85+
"type",
86+
"size",
87+
"rent",
88+
"owner",
89+
"owner_sex",
90+
"paid_until",
91+
"transfer_date",
92+
"transferee",
93+
"transfer_price",
94+
"transfer_accepted",
95+
"highest_bid",
96+
"highest_bidder",
97+
"auction_end",
98+
)
8099

81100
def __init__(self, name, world=None, **kwargs):
82101
self.id = kwargs.get("id", 0) # type: int
@@ -270,7 +289,11 @@ class CharacterHouse(abc.BaseHouseWithId):
270289
paid_until_date: :class:`datetime.date`
271290
The date the last paid rent is due.
272291
"""
273-
__slots__ = ("town", "owner", "paid_until_date")
292+
__slots__ = (
293+
"town",
294+
"owner",
295+
"paid_until_date",
296+
)
274297

275298
def __init__(self, _id, name, world=None, town=None, owner=None, paid_until_date=None):
276299
self.id = int(_id)
@@ -300,7 +323,11 @@ class GuildHouse(abc.BaseHouse):
300323
The owner of the guildhall.
301324
paid_until_date: :class:`datetime.date`
302325
The date the last paid rent is due."""
303-
__slots__ = ("owner", "paid_until_date")
326+
327+
__slots__ = (
328+
"owner",
329+
"paid_until_date",
330+
)
304331

305332
def __init__(self, name, world=None, owner=None, paid_until_date=None):
306333
self.name = name # type: str
@@ -341,7 +368,13 @@ class ListedHouse(abc.BaseHouseWithId):
341368
highest_bid: :class:`int`
342369
The highest bid so far, if the auction has started.
343370
"""
344-
__slots__ = ("town", "size", "rent", "time_left", "highest_bid")
371+
__slots__ = (
372+
"town",
373+
"size",
374+
"rent",
375+
"time_left",
376+
"highest_bid",
377+
)
345378

346379
def __init__(self, name, world, houseid, **kwargs):
347380
self.name = name # type: str

tibiapy/kill_statistics.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
from tibiapy import abc, InvalidContent
44
from tibiapy.utils import parse_tibiacom_content
55

6-
__all__ = ("KillStatistics", "RaceEntry")
6+
__all__ = (
7+
"KillStatistics",
8+
"RaceEntry",
9+
)
710

811
KILL_STATISTICS_URL = "https://www.tibia.com/community/?subtopic=killstatistics&world=%s"
912

@@ -20,7 +23,10 @@ class KillStatistics(abc.Serializable):
2023
total: :class:`RaceEntry`
2124
The kill statistics totals.
2225
"""
23-
__slots__ = ("world", "entries", "total")
26+
__slots__ = (
27+
"world",
28+
"entries",
29+
"total",)
2430

2531
def __init__(self, world, entries=None, total=None):
2632
self.world = world # type: str
@@ -111,7 +117,12 @@ class RaceEntry(abc.Serializable):
111117
last_week_players_killed: :class:`int`
112118
Number of players killed by this race in the last week.
113119
"""
114-
__slots__ = ("last_day_killed", "last_day_players_killed", "last_week_killed", "last_week_players_killed")
120+
__slots__ = (
121+
"last_day_killed",
122+
"last_day_players_killed",
123+
"last_week_killed",
124+
"last_week_players_killed",
125+
)
115126

116127
def __init__(self, last_day_killed=0, last_day_players_killed=0, last_week_killed=0, last_week_players_killed=0):
117128
self.last_day_killed = last_day_killed

tibiapy/news.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
from tibiapy.enums import NewsCategory, NewsType
88
from tibiapy.utils import parse_tibiacom_content, try_enum, parse_tibia_date
99

10-
__all__ = ("News", "ListedNews",)
10+
__all__ = (
11+
"News",
12+
"ListedNews",
13+
)
1114

1215

1316
ICON_PATTERN = re.compile(r"newsicon_([^_]+)_(?:small|big)")

tibiapy/world.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
from tibiapy.utils import parse_json, parse_tibia_datetime, parse_tibia_full_date, parse_tibiacom_content, \
1111
parse_tibiadata_datetime, try_date, try_datetime, try_enum
1212

13-
__all__ = ("ListedWorld", "World", "WorldOverview")
13+
__all__ = (
14+
"ListedWorld",
15+
"World",
16+
"WorldOverview",
17+
)
1418

1519
record_regexp = re.compile(r'(?P<count>[\d.,]+) players \(on (?P<date>[^)]+)\)')
1620
battleye_regexp = re.compile(r'since ([^.]+).')

0 commit comments

Comments
 (0)