From 6dc60a18c7929e3a1f0fee6aeb06913cc8921ccc Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Fri, 8 Aug 2008 20:55:08 +0000 Subject: 84: Renamed Proxy.__public to Proxy.__public__ so it works with Abstract.implements() --- ipalib/plugable.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'ipalib/plugable.py') diff --git a/ipalib/plugable.py b/ipalib/plugable.py index 4032b574..ad3d5872 100644 --- a/ipalib/plugable.py +++ b/ipalib/plugable.py @@ -144,8 +144,8 @@ class Proxy(ReadOnly): '__base', '__target', '__name_attr', - '__public', 'name', + '__public__', ) def __init__(self, base, target, name_attr='name'): @@ -156,26 +156,26 @@ class Proxy(ReadOnly): object.__setattr__(self, '_Proxy__base', base) object.__setattr__(self, '_Proxy__target', target) object.__setattr__(self, '_Proxy__name_attr', name_attr) - object.__setattr__(self, '_Proxy__public', base.__public__) + object.__setattr__(self, '__public__', base.__public__) object.__setattr__(self, 'name', getattr(target, name_attr)) - # Check __public - assert type(self.__public) is frozenset + # Check __public__ + assert type(self.__public__) is frozenset # Check name check_identifier(self.name) def __iter__(self): - for name in sorted(self.__public): + for name in sorted(self.__public__): yield name def __getitem__(self, key): - if key in self.__public: + if key in self.__public__: return getattr(self.__target, key) raise KeyError('no proxy attribute %r' % key) def __getattr__(self, name): - if name in self.__public: + if name in self.__public__: return getattr(self.__target, name) raise AttributeError('no proxy attribute %r' % name) -- cgit