97: Some whitespace and docstring cleanup; Plugin now subclasses from ProxyTarget

This commit is contained in:
Jason Gerard DeRose
2008-08-09 05:19:40 +00:00
parent 409f688ef5
commit 9712eae51c

View File

@@ -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