Skip to content

Commit eb0046d

Browse files
committed
fixed weakref
1 parent 79d80b2 commit eb0046d

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

tryhackme/game.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from .user import KOTHUser
22

33
class KingoftheHill:
4-
__slot__ = ("_state", "id", "start_time", "finnish_time", "status", "flag_count", "resets", "game_type", "ceator", "users", "King", )
4+
__slot__ = ("__weakref__", "_state", "id", "start_time", "finnish_time", "status", "flag_count", "resets", "game_type", "ceator", "users", "King", )
55

66
def __init__(self, state, data):
77
self._state = state

tryhackme/module.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22

33
class Module:
4-
__slots__ = ("_state", "_rooms", "_prerequisites", "_next_steps", "name", "code", "id", "description", "summary", )
4+
__slots__ = ("__weakref__", "_state", "_rooms", "_prerequisites", "_next_steps", "name", "code", "id", "description", "summary", )
55

66
def __init__(self, state, data):
77
self._state = state

tryhackme/path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from . import utils
33

44
class Path:
5-
__slots__ = ("_state", "_badges", "_careers", "_modules", "_tasks", "code", "raw_description", "color", "raw_intro", "type", "public", "room_count", "summary", "difficult", "time_to_complete", )
5+
__slots__ = ("__weakref__", "_state", "_badges", "_careers", "_modules", "_tasks", "code", "raw_description", "color", "raw_intro", "type", "public", "room_count", "summary", "difficult", "time_to_complete", )
66

77
def __init__(self, state, data):
88
self._state = state

tryhackme/room.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# ? writeups class
55

66
class Room:
7-
__slots__ = ("_state", "_creators", "name", "id", "title", "description", "created", "published", "users", "type", "public", "difficulty", "freeToUse", "ctf", "tags", "ipType", "simpleRoom", "writeups", "locked", "comingSoon", "views", "certificate", "timeToComplete", "userCompleted", )
7+
__slots__ = ("__weakref__", "_state", "_creators", "name", "id", "title", "description", "created", "published", "users", "type", "public", "difficulty", "freeToUse", "ctf", "tags", "ipType", "simpleRoom", "writeups", "locked", "comingSoon", "views", "certificate", "timeToComplete", "userCompleted", )
88

99
def __init__(self, state, data):
1010
self._state = state

tryhackme/serie.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22

33
class Serie:
4-
__slots__ = ("_state", "_rooms", "id", "code", "name", "description", "difficulty", )
4+
__slots__ = ("__weakref__", "_state", "_rooms", "id", "code", "name", "description", "difficulty", )
55
def __init__(self, state, data):
66
self._state = state
77

tryhackme/user.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ def completed_rooms(self):
3838
return [self._state.get_room(room.get("code")) for room in self._completed_rooms]
3939

4040
class User(BaseUser):
41-
__slots__ = BaseUser.__slots__
41+
__slots__ = BaseUser.__slots__ + ("__weakref__", )
4242
pass
4343

4444
class KOTHUser(BaseUser):
45-
__slots__ = BaseUser.__slots__ + ("level", "country", "score", "flags", "king_time", "game_rank", )
45+
__slots__ = BaseUser.__slots__ + ("__weakref__", "_state", "name", "rank", "points", "subscribed", "_completed_rooms", "_badges", "level", "country", "score", "flags", "king_time", "game_rank", )
4646

4747
def __init__(self, state, data):
4848
super().__init__(state, data.get("username"))
@@ -58,7 +58,7 @@ def _from_koth(self, data):
5858

5959

6060
class ClientUser(BaseUser):
61-
__slots__ = BaseUser.__slots__ + ("_message_groups", "_team", )
61+
__slots__ = BaseUser.__slots__ + ("__weakref__", "_message_groups", "_team", )
6262

6363
def __init__(self, state, username):
6464
super().__init__(state, username)

0 commit comments

Comments
 (0)