summaryrefslogtreecommitdiffstats
path: root/protocol.py
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2014-09-01 14:01:09 +0200
committerJan Pokorný <jpokorny@redhat.com>2014-09-01 14:15:20 +0200
commit7175d05335dbed0dde0e06d5de19954b6ca47042 (patch)
tree360d3a81e3a370406f66bb7aedbbf1e525c960af /protocol.py
parent0ca4785280c45289319b63ef6608eca996112037 (diff)
downloadclufter-7175d05335dbed0dde0e06d5de19954b6ca47042.tar.gz
clufter-7175d05335dbed0dde0e06d5de19954b6ca47042.tar.xz
clufter-7175d05335dbed0dde0e06d5de19954b6ca47042.zip
plugin_registry vs. protocol(s): "kludge" -> fixed feature
In fact, commit 8dd14ec29fe829e9edf0102e45966a4a1cc012d7 commented out what was intentionally present to prevent RuntimeWarning due to importing discovered plugins to the yet non-existent module namespace (missing parent) in case the respective registry hadn't been imported in advance. That commit tried to solve a conflict with protol.py, which referred to "clufter.plugins" module namespace, but unlike the previous registries (formats, filters, commands), "plugins" is not backed by a real module (i.e., neither plugins.py nor plugins/__init__.py exist at the top level). Solution is simple, make protocols registry set the namespace as a non-value, which is then considered a signal not to attempt any such for-the-sake-of-sanity complementary import. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to 'protocol.py')
-rw-r--r--protocol.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/protocol.py b/protocol.py
index 54c81d4..ed0f546 100644
--- a/protocol.py
+++ b/protocol.py
@@ -22,6 +22,8 @@ class protocols(PluginRegistry):
in-code documentation of their usage as opposed to much further
in the processing with some files already successfully produced, etc.
"""
+ _namespace = '' # avoid the plugins module-import namespace, unused anyway
+
@classmethod
def register(registry, pr):
# undecor to pass the checks in probe