diff options
author | Nagappan <nagapan@gmail.com> | 2010-04-05 22:27:37 -0700 |
---|---|---|
committer | Nagappan <nagapan@gmail.com> | 2010-04-05 22:27:37 -0700 |
commit | 0936f4c7f51025878b4179a91a1228b7017de700 (patch) | |
tree | 52423b16448fbd581432c12d132097a3e4cf9e37 /ooldtp | |
parent | 7cdf7748f60bac109e1aa414c6bd48ec3329c330 (diff) |
Fixes bug 547572
Diffstat (limited to 'ooldtp')
-rw-r--r-- | ooldtp/_context.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/ooldtp/_context.py b/ooldtp/_context.py index 5bc2b91..4cbd0a2 100644 --- a/ooldtp/_context.py +++ b/ooldtp/_context.py @@ -69,18 +69,6 @@ class Context(_Wrapper): return args and 'window_name' == args[0] _isRelevant = classmethod(_isRelevant) - def getchild(self, child_name='', role=''): - # TODO: Bad API choice. Inconsistent, should return object or list, - # not both. UPDATE: Only returns first match. - matches = self._remote_getchild(child_name, role, True) - if matches: - if role: - return [Component(self._window_name, matches[0])] - else: - return Component(self._window_name, matches[0]) - else: - return None - class _ContextFuncWrapper: def __init__(self, window_name, func): self._window_name = window_name @@ -99,6 +87,18 @@ class Component(_Wrapper): def getName(self): return self._object_name + def getchild(self, child_name='', role=''): + # TODO: Bad API choice. Inconsistent, should return object or list, + # not both. UPDATE: Only returns first match. + matches = self._remote_getchild(child_name, role, True) + if matches: + if role: + return [Component(self._window_name, matches[0])] + else: + return Component(self._window_name, matches[0]) + else: + return None + def __repr__(self): return 'Component "%s" in "%s"' % \ (self._object_name, self._window_name) |