diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-08-11 21:14:07 +0000 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-08-11 21:14:07 +0000 |
commit | c1a125256b302eceebcee5464f1447fc8e49fdf7 (patch) | |
tree | 2fc5f3ff21239fb28f52b8468163b33c4792f411 /ipalib/public.py | |
parent | 92824182911007ce3e9cf4f858f70434594ee5dd (diff) | |
download | freeipa.git-c1a125256b302eceebcee5464f1447fc8e49fdf7.tar.gz freeipa.git-c1a125256b302eceebcee5464f1447fc8e49fdf7.tar.xz freeipa.git-c1a125256b302eceebcee5464f1447fc8e49fdf7.zip |
111: Minor changes to mthd and prop classes; updated mthd and prop unit tests
Diffstat (limited to 'ipalib/public.py')
-rw-r--r-- | ipalib/public.py | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/ipalib/public.py b/ipalib/public.py index 48e19ff4..95ba7554 100644 --- a/ipalib/public.py +++ b/ipalib/public.py @@ -136,7 +136,6 @@ class cmd(plugable.Plugin): '__call__', 'get_doc', 'options', - )) __options = None option_classes = tuple() @@ -248,6 +247,10 @@ class obj(plugable.Plugin): class attr(plugable.Plugin): + __public__ = frozenset(( + 'obj', + 'obj_name', + )) __obj = None def __init__(self): @@ -278,17 +281,18 @@ class attr(plugable.Plugin): class mthd(attr, cmd): - __public__ = frozenset(( - 'obj', - 'obj_name', - )) + __public__ = attr.__public__.union(cmd.__public__) + def get_options(self): + for proxy in cmd.get_options(self): + yield proxy + if self.obj is not None and self.obj.prop is not None: + for proxy in self.obj.prop: + yield proxy -class prop(attr): - __public__ = frozenset(( - 'obj', - 'obj_name', - )) + +class prop(attr, option): + __public__ = attr.__public__.union(option.__public__) def get_doc(self, _): return _('prop doc') |