component(developer/golang-123): Add Component
[oi-userland.git] / components / python / pyatspi / patches / 01-py37-compat.patch
blob948abb2a25a4704e53aa96b0837c026b39087f2b
1 https://gitlab.gnome.org/GNOME/pyatspi2/-/issues/1
3 --- pyatspi-2.24.0/pyatspi/registry.py.orig
4 +++ pyatspi-2.24.0/pyatspi/registry.py
5 @@ -50,9 +50,9 @@
6 reference to the Accessibility.Registry singleton. Doing so is harmless and
7 has no point.
9 - @@ivar async: Should event dispatch to local listeners be decoupled from event
10 - receiving from the registry?
11 - @@type async: boolean
12 + @@ivar asynchronous: Should event dispatch to local listeners be decoupled
13 + from event receiving from the registry?
14 + @@type asynchronous: boolean
15 @@ivar reg: Reference to the real, wrapped registry object
16 @@type reg: Accessibility.Registry
17 @@ivar dev: Reference to the device controller
18 @@ -111,25 +111,44 @@
20 self.has_implementations = True
22 - self.async = False # not fully supported yet
23 + self.asynchronous = False # not fully supported yet
24 self.started = False
25 self.event_listeners = dict()
27 + def __getattr__(self, name):
28 + """
29 + For backwards compatibility with old API
30 + """
31 + if name == 'async':
32 + return self.asynchronous
33 + return object.__getattr__(self, name)
35 + def __setattr__(self, name, value):
36 + """
37 + For backwards compatibility with old API
38 + """
39 + if name == 'async':
40 + self.asynchronous = value
41 + object.__setattr__(self, name, value)
43 def _set_default_registry (self):
44 self._set_registry (MAIN_LOOP_GLIB)
46 - def start(self, async=False, gil=True):
47 + def start(self, asynchronous=False, gil=True, **kwargs):
48 """
49 Enter the main loop to start receiving and dispatching events.
51 - @@param async: Should event dispatch be asynchronous (decoupled) from
52 - event receiving from the AT-SPI registry?
53 - @@type async: boolean
54 + @@param asynchronous: Should event dispatch be asynchronous
55 + (decoupled) from event receiving from the AT-SPI registry?
56 + @@type asynchronous: boolean
57 @@param gil: Add an idle callback which releases the Python GIL for a few
58 milliseconds to allow other threads to run? Necessary if other threads
59 will be used in this process.
60 @@type gil: boolean
61 """
62 + if 'async' in kwargs:
63 + # support previous API
64 + asynchronous = kwargs['async']
65 if not self.has_implementations:
66 self._set_default_registry ()
67 self.started = True