diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-09-21 21:50:56 +0000 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-09-21 21:50:56 +0000 |
commit | f73d976bdacae37557f0b2ccfa6da01ea58c685d (patch) | |
tree | 78f98c60cc3f268b3354ae6fda69d296ff330ae1 /ipalib/public.py | |
parent | 5872221bd49dda962391ddfb88f22e86bf72afec (diff) | |
download | freeipa.git-f73d976bdacae37557f0b2ccfa6da01ea58c685d.tar.gz freeipa.git-f73d976bdacae37557f0b2ccfa6da01ea58c685d.tar.xz freeipa.git-f73d976bdacae37557f0b2ccfa6da01ea58c685d.zip |
307: Split Plugin.finalize() into two steps 1) Plugin.set_api() and 2) Plugin.finalize(); updated unit tests
Diffstat (limited to 'ipalib/public.py')
-rw-r--r-- | ipalib/public.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/ipalib/public.py b/ipalib/public.py index 78fa0983..c4850747 100644 --- a/ipalib/public.py +++ b/ipalib/public.py @@ -237,8 +237,7 @@ class Command(plugable.Plugin): options = None params = None - def finalize(self, api): - super(Command, self).finalize(api) + def finalize(self): self.args = plugable.NameSpace(self.__check_args(), sort=False) if len(self.args) == 0 or not self.args[-1].multivalue: self.max_args = len(self.args) @@ -248,6 +247,7 @@ class Command(plugable.Plugin): self.params = plugable.NameSpace( tuple(self.args()) + tuple(self.options()), sort=False ) + super(Command, self).finalize() def get_args(self): return self.takes_args @@ -395,11 +395,12 @@ class Object(plugable.Plugin): return self.__Property Property = property(__get_Property) - def finalize(self, api): - super(Object, self).finalize(api) + def set_api(self, api): + super(Object, self).set_api(api) self.__Method = self.__create_namespace('Method') self.__Property = self.__create_namespace('Property') + def __create_namespace(self, name): return plugable.NameSpace(self.__filter_members(name)) @@ -443,9 +444,9 @@ class Attribute(plugable.Plugin): return self.__obj obj = property(__get_obj) - def finalize(self, api): - super(Attribute, self).finalize(api) + def set_api(self, api): self.__obj = api.Object[self.obj_name] + super(Attribute, self).set_api(api) class Method(Attribute, Command): |