Skip to content

Commit 70ce2e1

Browse files
committed
WIP3
1 parent f5814f3 commit 70ce2e1

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

mininterface/_mininterface/adaptor.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,16 @@ class BackendAdaptor(ABC):
2626

2727
def __init__(self, interface: "Mininterface", settings: UiSettings | None):
2828
self.interface = interface
29+
2930
# NOTE self.__annotations__ will pose problem at Python3.14
30-
self.facet = interface.facet = self.__annotations__["facet"](self, interface.env)
31-
self.settings = settings or self.__annotations__["settings"]()
31+
for cl in type(self).__mro__:
32+
try:
33+
self.facet = interface.facet = cl.__annotations__["facet"](self, interface.env)
34+
self.settings = settings or cl.__annotations__["settings"]()
35+
except KeyError:
36+
pass
37+
else:
38+
break
3239

3340
@abstractmethod
3441
def widgetize(self, tag: Tag):

0 commit comments

Comments
 (0)