From cc5b0174949a4769876a892b210a9faa9683d81e Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Sat, 9 Aug 2008 01:06:42 +0000 Subject: 93: Added Proxy.implements() method; addeded corresponding unit tests --- ipalib/plugable.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'ipalib/plugable.py') diff --git a/ipalib/plugable.py b/ipalib/plugable.py index c5ceeffe..1e1f4a90 100644 --- a/ipalib/plugable.py +++ b/ipalib/plugable.py @@ -102,7 +102,7 @@ class Proxy(ReadOnly): Allows access to only certain attributes on its target object (a ProxyTarget). - Think of a proxy as an argreement that "I will have at most these + Think of a proxy as an agreement that "I will have at most these attributes". This is different from (although similar to) an interface, which can be thought of as an agreement that "I will have at least these attributes". @@ -136,9 +136,13 @@ class Proxy(ReadOnly): check_identifier(self.name) self.__lock__() + def implements(self, arg): + return self.__base.implements(arg) + def __iter__(self): """ - Iterates though the attribute names this proxy is allowing access to. + Iterates (in ascending order) though the attribute names this proxy is + allowing access to. """ for name in sorted(self.__public__): yield name @@ -176,6 +180,7 @@ class Proxy(ReadOnly): ) + class Plugin(object): """ Base class for all plugins. -- cgit