mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
- Allow access to poperties of the "application" OSA class directly from
the toplevel package. This already worked for elements, but now for properties too. Fixes #753925. - Even better, the toplevel class (such as Finder.Finder) now inherits the element and property dictionaries of its application class and has the necessary glue to allow you to say f = Finder.Finder() f.get(f.name)
This commit is contained in:
parent
fdbe5223b7
commit
c8882b10c4
2 changed files with 25 additions and 3 deletions
|
@ -154,7 +154,7 @@ class TalkTo:
|
|||
Evt.WaitNextEvent(0,0)
|
||||
return 1
|
||||
__ensure_WMAvailable = classmethod(__ensure_WMAvailable)
|
||||
|
||||
|
||||
def __init__(self, signature=None, start=0, timeout=0):
|
||||
"""Create a communication channel with a particular application.
|
||||
|
||||
|
@ -284,6 +284,18 @@ class TalkTo:
|
|||
|
||||
set = _set
|
||||
|
||||
# Magic glue to allow suite-generated classes to function somewhat
|
||||
# like the "application" class in OSA.
|
||||
|
||||
def __getattr__(self, name):
|
||||
if self._elemdict.has_key(name):
|
||||
cls = self._elemdict[name]
|
||||
return DelayedComponentItem(cls, None)
|
||||
if self._propdict.has_key(name):
|
||||
cls = self._propdict[name]
|
||||
return cls()
|
||||
raise AttributeError, name
|
||||
|
||||
# Tiny Finder class, for local use only
|
||||
|
||||
class _miniFinder(TalkTo):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue