Skip to content

Commit 1519a77

Browse files
committed
Merge branch 'develop'
2 parents 3d3eea4 + c68a11a commit 1519a77

File tree

11 files changed

+46
-7
lines changed

11 files changed

+46
-7
lines changed

.github/workflows/build_exe.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: windows-latest
1010
steps:
1111
- name: Checkout
12-
uses: actions/checkout@v3
12+
uses: actions/checkout@v4
1313
- name: Set up Python
1414
uses: actions/setup-python@v5
1515
with:

docs/source/changelog.rst

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

40+
v4.0.4
41+
=====================
42+
- Fixed automatic responder's not being removable over a remote connection.
43+
- Fixed casting error when trying to update objects with ``Literal`` parameters.
44+
- Other GUI fixes (from tkclasswiz library)
45+
46+
4047
v4.0.3
4148
====================
4249
- Fixed object editing window saving to an incorrect index (and removing other objects).

requirements/docs.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
sphinx==7.1.2
22
sphinx-autobuild==2021.3.14
33
sphinx-copybutton==0.5.2
4-
furo==2023.9.10
4+
furo==2024.1.29
55
enum-tools[sphinx]==0.11.0
66
sphinx-design[furo]==0.5.0
77
readthedocs-sphinx-search==0.3.2

src/daf/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import warnings
2323

2424

25-
VERSION = "4.0.3"
25+
VERSION = "4.0.4"
2626

2727

2828
if sys.version_info.minor == 12 and sys.version_info.major == 3:

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/extra_widgets.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,16 @@ async def update():
106106
values = {}
107107
for k, v in frame.get_gui_data().items():
108108
if isinstance(v, str):
109-
v = frame.cast_type(v, frame._map[k][1])
109+
types_ = frame._map[k][1]
110+
try:
111+
frame.cast_type(v, types_)
112+
except TypeError as exc:
113+
# Perhaps it's a valid literal:
114+
literal_types = frame.filter_literals(types_)
115+
if not literal_types:
116+
raise
117+
118+
frame.check_literals(v, literal_types)
110119

111120
values[k] = convert_to_objects(v)
112121

0 commit comments

Comments
 (0)