From f3aaf65f1c4bbee31dae9431423ab88a15eba990 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Wed, 24 Sep 2008 00:44:41 +0000 Subject: 320: plugable.API now respects the Plugin.__proxy__ flag; added test for plugins without proxy to unit tests for API --- ipalib/plugable.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ipalib/plugable.py') diff --git a/ipalib/plugable.py b/ipalib/plugable.py index 6e12d5c7..f883eb12 100644 --- a/ipalib/plugable.py +++ b/ipalib/plugable.py @@ -241,6 +241,7 @@ class Plugin(ReadOnly): Base class for all plugins. """ __public__ = frozenset() + __proxy__ = True __api = None def __get_name(self): @@ -709,7 +710,10 @@ class API(DictProxy): if klass not in instances: instances[klass] = klass() plugin = instances[klass] - yield PluginProxy(base, plugin) + if base.__proxy__: + yield PluginProxy(base, plugin) + else: + yield plugin for name in self.register: base = self.register[name] -- cgit