diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-08-09 01:46:12 +0000 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-08-09 01:46:12 +0000 |
commit | 3495c67d57868a02bafe6f1935d4846cd5615bf5 (patch) | |
tree | 389815c4ddaec1777ddb789751e1b83a595b1324 /ipalib/plugable.py | |
parent | cc5b0174949a4769876a892b210a9faa9683d81e (diff) | |
download | freeipa-3495c67d57868a02bafe6f1935d4846cd5615bf5.tar.gz freeipa-3495c67d57868a02bafe6f1935d4846cd5615bf5.tar.xz freeipa-3495c67d57868a02bafe6f1935d4846cd5615bf5.zip |
94: Renamed Proxy._clone() method to Proxy.__clone__(); updated unit tests
Diffstat (limited to 'ipalib/plugable.py')
-rw-r--r-- | ipalib/plugable.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ipalib/plugable.py b/ipalib/plugable.py index 1e1f4a90..c5ec08ec 100644 --- a/ipalib/plugable.py +++ b/ipalib/plugable.py @@ -139,6 +139,14 @@ class Proxy(ReadOnly): def implements(self, arg): return self.__base.implements(arg) + def __clone__(self, name_attr): + """ + Returns a Proxy instance identical to this one except the proxy name + might be derived from a different attribute on the target. The same + base and target will be used. + """ + return self.__class__(self.__base, self.__target, name_attr) + def __iter__(self): """ Iterates (in ascending order) though the attribute names this proxy is @@ -168,8 +176,6 @@ class Proxy(ReadOnly): def __call__(self, *args, **kw): return self['__call__'](*args, **kw) - def _clone(self, name_attr): - return self.__class__(self.__base, self.__target, name_attr) def __repr__(self): return '%s(%s, %r, %r)' % ( |