diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-08-06 15:06:39 +0000 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-08-06 15:06:39 +0000 |
commit | 495f96a73f20f0d0331099251d2472f216d05cac (patch) | |
tree | 9693a2cb1831801a54066bfa77314c24578e3112 | |
parent | 4e825ba2d9d292af17acdecb2e7f739c3355a464 (diff) | |
download | freeipa.git-495f96a73f20f0d0331099251d2472f216d05cac.tar.gz freeipa.git-495f96a73f20f0d0331099251d2472f216d05cac.tar.xz freeipa.git-495f96a73f20f0d0331099251d2472f216d05cac.zip |
62: NameSpace no longer takes base=base kwarg
-rw-r--r-- | ipalib/plugable.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/ipalib/plugable.py b/ipalib/plugable.py index 4a790a37..ee65c516 100644 --- a/ipalib/plugable.py +++ b/ipalib/plugable.py @@ -174,13 +174,12 @@ class NameSpace(ReadOnly): both as instance attributes and as dictionary items. """ - def __init__(self, items, base=None): + def __init__(self, items): """ `items` should be an iterable providing the members of this NameSpace. """ object.__setattr__(self, '_NameSpace__items', tuple(items)) - object.__setattr__(self, '_NameSpace__base', base) # dict mapping Python name to item: object.__setattr__(self, '_NameSpace__pname', {}) @@ -229,11 +228,7 @@ class NameSpace(ReadOnly): raise KeyError('NameSpace has no item for key %r' % key) def __repr__(self): - if self.__base is None: - base = repr(self.__base) - else: - base = '%s.%s' % (self.__base.__module__, self.__base.__name__) - return '%s(*proxies, base=%s)' % (self.__class__.__name__, base) + return '%s(<%d proxies>)' % (self.__class__.__name__, len(self)) class Registrar(object): @@ -338,7 +333,7 @@ class API(ReadOnly): Finalize the registration, instantiate the plugins. """ for (base, plugins) in self.register: - ns = NameSpace(self.__plugin_iter(base, plugins), base=base) + ns = NameSpace(self.__plugin_iter(base, plugins)) assert not hasattr(self, base.__name__) object.__setattr__(self, base.__name__, ns) for plugin in self.__plugins: |