@@ -18,7 +18,7 @@ def __init__(self, username, account_type=None):
18
18
self ._api_response = None
19
19
20
20
if self ._type is None :
21
- self ._find_account_type () # _type is set inside _find_account_type
21
+ self ._find_account_type () # _type is set inside _find_account_type
22
22
23
23
self .rank , self .total_level , self .total_xp = - 1 , - 1 , - 1
24
24
@@ -29,7 +29,8 @@ def __init__(self, username, account_type=None):
29
29
self .update ()
30
30
31
31
def update (self ):
32
- # In the default case (account_type=None), we already have this information. We don't need to do it again
32
+ # In the default case (account_type=None), we already have this
33
+ # information. We don't need to do it again
33
34
if self ._api_response is None :
34
35
self ._api_response = self ._get_api_data ()
35
36
self ._set_data ()
@@ -50,7 +51,7 @@ def _find_account_type(self):
50
51
self ._type = possible_type
51
52
self ._api_response = self ._get_api_data ()
52
53
return
53
- except :
54
+ except BaseException :
54
55
pass
55
56
56
57
self ._raise_bad_username ()
@@ -87,7 +88,7 @@ def _set_data(self):
87
88
# Get all the skills, minigames, or bosses
88
89
def _get_api_chunk (cls , * , names , start_index ):
89
90
"""
90
- cls: Skill, Minigame, or Boss - Type of the chunk
91
+ cls: Skill, Minigame, or Boss - Type of the chunk
91
92
names: List[str] - a list of all the (Skill, Minigame, or Boss) names in the order the API returns them.
92
93
(const.SKILLS, const.MINIGAMES, or const.BOSSES)
93
94
start_index: The index into self._api_response where the chunk begins
@@ -96,11 +97,13 @@ def _get_api_chunk(cls, *, names, start_index):
96
97
chunk = {}
97
98
98
99
for i , name in enumerate (names , start = start_index ):
99
- if name == const .UNUSED_OR_UNKNOWN :
100
+ if (self ._type is not const .AccountType .SEASONAL and name ==
101
+ "League Points" ):
100
102
continue
101
103
102
104
# The API only returns integers
103
- row_data = [int (col ) for col in self ._api_response [i ].split ("," )]
105
+ row_data = [int (col )
106
+ for col in self ._api_response [i ].split ("," )]
104
107
105
108
chunk [name ] = cls (name , * row_data )
106
109
0 commit comments