summaryrefslogtreecommitdiffstats
path: root/ipsilon/providers/openid/extensions
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2014-10-23 11:45:32 -0400
committerPatrick Uiterwijk <puiterwijk@redhat.com>2014-11-12 23:47:15 +0100
commit83da2bf3963db3e4427bced3b4c0681e751e54da (patch)
tree53f03ce8e60d2c68453cdb5fe6be9aad7ce2c362 /ipsilon/providers/openid/extensions
parent0c14f7600de70baf5b3ee609288207dcdb65e1ae (diff)
downloadipsilon.git-83da2bf3963db3e4427bced3b4c0681e751e54da.tar.gz
ipsilon.git-83da2bf3963db3e4427bced3b4c0681e751e54da.tar.xz
ipsilon.git-83da2bf3963db3e4427bced3b4c0681e751e54da.zip
Refactor plugin configuration
Fork a PluginConfig class out of PluginObject, the base object now supports a simple dictionary config, while using PluginConfig provide access to structured util.config based configuration. Change UI code that deal with plugins configuration to properly use the new structured config objects in order to represent data in appropriate format based on the data type. Use the new util.config objects to represent plugins configuration. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Diffstat (limited to 'ipsilon/providers/openid/extensions')
-rwxr-xr-xipsilon/providers/openid/extensions/common.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/ipsilon/providers/openid/extensions/common.py b/ipsilon/providers/openid/extensions/common.py
index b75d394..804f695 100755
--- a/ipsilon/providers/openid/extensions/common.py
+++ b/ipsilon/providers/openid/extensions/common.py
@@ -49,13 +49,14 @@ FACILITY = 'openid_extensions'
class LoadExtensions(Log):
- def __init__(self, enabled):
+ def __init__(self):
loader = PluginLoader(LoadExtensions, FACILITY, 'OpenidExtension')
self.plugins = loader.get_plugin_data()
available = self.plugins['available'].keys()
self._debug('Available Extensions: %s' % str(available))
+ def enable(self, enabled):
for item in enabled:
if item not in self.plugins['available']:
self.debug('<%s> not available' % item)
@@ -63,5 +64,8 @@ class LoadExtensions(Log):
self.debug('Enable OpenId extension: %s' % item)
self.plugins['available'][item].enable()
- def get_extensions(self):
- return self.plugins['available']
+ def available(self):
+ available = self.plugins['available']
+ if available is None:
+ available = dict()
+ return available