diff options
author | Kali Kaneko <kali@leap.se> | 2015-06-05 13:11:24 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2015-06-15 14:24:20 -0400 |
commit | 2621315fc2d52f2b11b95704c06c36dc7fdc6339 (patch) | |
tree | a868a51a20794d0bbd1f7d409b8cee0c135b4457 /client/src/leap | |
parent | b5116f79a121c6a9360faa29e7da095a09d14494 (diff) |
[refactor] move collect_plugins to leap.common
Diffstat (limited to 'client/src/leap')
-rw-r--r-- | client/src/leap/soledad/client/api.py | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/client/src/leap/soledad/client/api.py b/client/src/leap/soledad/client/api.py index 01c06f20..fd91ff8b 100644 --- a/client/src/leap/soledad/client/api.py +++ b/client/src/leap/soledad/client/api.py @@ -47,6 +47,7 @@ from twisted.plugin import getPlugins from zope.interface import implements from leap.common.config import get_path_prefix +from leap.common.plugins import collect_plugins from leap.soledad.common import SHARED_DB_NAME from leap.soledad.common import soledad_assert @@ -72,28 +73,6 @@ Soledad client and server. """ SOLEDAD_CERT = None -# A whitelist of modules from where to collect plugins dynamically. -# For the moment restricted to leap namespace, but the idea is that we can pass -# other "trusted" modules as options to the initialization of soledad. -PLUGGABLE_LEAP_MODULES = ('mail', 'keymanager') - - -# TODO move to leap.common - -def collect_plugins(interface): - """ - Traverse a whitelist of modules and collect all the plugins that implement - the passed interface. - """ - plugins = [] - for namespace in PLUGGABLE_LEAP_MODULES: - try: - module = __import__('leap.%s.plugins' % namespace, fromlist='.') - plugins = plugins + list(getPlugins(interface, module)) - except ImportError: - pass - return plugins - class Soledad(object): """ |