diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-08-09 05:19:40 +0000 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-08-09 05:19:40 +0000 |
commit | 9712eae51ce072962a7e969684ba9e8b4ec19dd9 (patch) | |
tree | b0be686564e9b7f2a200ed0dcd7ad2172a8bbf14 /ipalib/plugable.py | |
parent | 409f688ef5ed453708df29913036593f7fa51e41 (diff) | |
download | freeipa.git-9712eae51ce072962a7e969684ba9e8b4ec19dd9.tar.gz freeipa.git-9712eae51ce072962a7e969684ba9e8b4ec19dd9.tar.xz freeipa.git-9712eae51ce072962a7e969684ba9e8b4ec19dd9.zip |
97: Some whitespace and docstring cleanup; Plugin now subclasses from ProxyTarget
Diffstat (limited to 'ipalib/plugable.py')
-rw-r--r-- | ipalib/plugable.py | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/ipalib/plugable.py b/ipalib/plugable.py index d8578270..2bef3de7 100644 --- a/ipalib/plugable.py +++ b/ipalib/plugable.py @@ -150,8 +150,8 @@ class Proxy(ReadOnly): '__base', '__target', '__name_attr', - 'name', '__public__', + 'name', ) def __init__(self, base, target, name_attr='name'): @@ -169,9 +169,9 @@ class Proxy(ReadOnly): self.__base = base self.__target = target self.__name_attr = name_attr - self.name = getattr(target, name_attr) self.__public__ = base.__public__ assert type(self.__public__) is frozenset + self.name = getattr(target, name_attr) check_identifier(self.name) self.__lock__() @@ -225,8 +225,7 @@ class Proxy(ReadOnly): ) - -class Plugin(object): +class Plugin(ProxyTarget): """ Base class for all plugins. """ @@ -252,16 +251,10 @@ class Plugin(object): assert api is not None, 'finalize() argument cannot be None' self.__api = api - def __get_name(self): - """ - Returns the class name of this instance. - """ - return self.__class__.__name__ - name = property(__get_name) - def __repr__(self): """ - Returns a fully qualified <module><name> representation of the class. + Returns a fully qualified module_name.class_name() representation that + could be used to contruct this instance. """ return '%s.%s()' % ( self.__class__.__module__, @@ -269,12 +262,6 @@ class Plugin(object): ) - - - - - - class NameSpace(ReadOnly): """ A read-only namespace of (key, value) pairs that can be accessed |