Skip to content

Commit 6782f34

Browse files
committed
Fixed auto responder over remote
1 parent 848ef85 commit 6782f34

File tree

7 files changed

+31
-3
lines changed

7 files changed

+31
-3
lines changed

docs/source/changelog.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ Glossary
3737
Releases
3838
---------------------
3939

40+
|UNRELEASED| v4.0.4
41+
=====================
42+
- Fixed automatic responder's not being removable over a remote connection.
43+
44+
4045
v4.0.3
4146
====================
4247
- Fixed object editing window saving to an incorrect index (and removing other objects).

src/daf/convert.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,18 @@ def import_class(path: str):
158158
"custom_decoder": lambda data: re.compile(data["pattern"], data.get("flags", 0))
159159
},
160160
responder.DMResponder: {
161-
"attrs": ["condition", "action", "constraints"]
161+
"attrs": attributes.get_all_slots(responder.DMResponder),
162+
"attrs_restore": {
163+
"client": None,
164+
"event_ctrl": None
165+
}
166+
},
167+
responder.GuildResponder: {
168+
"attrs": attributes.get_all_slots(responder.GuildResponder),
169+
"attrs_restore": {
170+
"client": None,
171+
"event_ctrl": None
172+
}
162173
}
163174
}
164175

src/daf/misc/instance_track.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
from weakref import WeakValueDictionary
66
from functools import wraps
77

8+
from .attributes import get_all_slots
9+
810

911
__all__ = (
1012
"get_by_id",
@@ -59,7 +61,7 @@ def track_id(cls):
5961
"""
6062
@wraps(cls, updated=[])
6163
class TrackedClass(cls):
62-
if hasattr(cls, "__slots__") and cls.__slots__: # Don't break classes without slots
64+
if hasattr(cls, "__slots__") and get_all_slots(cls): # Don't break classes without slots
6365
__slots__ = ["_daf_id", "_tracked_allow_remote"]
6466
if not hasattr(cls, "__weakref__"):
6567
__slots__.append('__weakref__')

src/daf/responder/base.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ class ResponderBase(ABC):
3131
before performing an action.
3232
All of the constraints inside the ``constraints`` list need to be fulfilled.
3333
"""
34+
__slots__ = (
35+
"condition",
36+
"constraints",
37+
"action",
38+
"event_ctrl",
39+
"client",
40+
)
41+
3442
def __init__(
3543
self,
3644
condition: BaseLogic,

src/daf/responder/dmresponder.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
@doc_category("Auto responder", path="responder")
2121
class DMResponder(ResponderBase):
2222
__doc__ = "DM responder implementation. " + ResponderBase.__doc__
23+
__slots__ = tuple()
2324

2425
@typechecked
2526
def __init__(

src/daf/responder/guildresponder.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
@doc_category("Auto responder", path="responder")
2121
class GuildResponder(ResponderBase):
2222
__doc__ = "Guild responder implementation. " + ResponderBase.__doc__
23+
__slots__ = tuple()
2324

2425
@typechecked
2526
def __init__(

src/daf_gui/tod_extensions/method_execution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
},
4444
daf.ACCOUNT.remove_responder: {
4545
# ACCOUNT.servers
46-
"responder_to_remove": lambda old_info: old_info.data["responders"]
46+
"resp": lambda old_info: old_info.data["responders"]
4747
}
4848
}
4949

0 commit comments

Comments
 (0)