summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBarry Warsaw2009-03-09 23:42:21 -0400
committerBarry Warsaw2009-03-09 23:42:21 -0400
commit11eb3395ad1f7c9f6699f96c33ca0543c2f83220 (patch)
tree3cbf2f18672724fe454bec2dfc1e011748aa981a /src
parentf4975570e9c12670b92e3c55f01e31fa4a20879a (diff)
downloadmailman-11eb3395ad1f7c9f6699f96c33ca0543c2f83220.tar.gz
mailman-11eb3395ad1f7c9f6699f96c33ca0543c2f83220.tar.zst
mailman-11eb3395ad1f7c9f6699f96c33ca0543c2f83220.zip
Diffstat (limited to 'src')
-rw-r--r--src/mailman/app/commands.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/mailman/app/commands.py b/src/mailman/app/commands.py
index d7676af9c..cd4513629 100644
--- a/src/mailman/app/commands.py
+++ b/src/mailman/app/commands.py
@@ -25,18 +25,27 @@ __all__ = [
]
+import sys
+
+from mailman import commands
from mailman.config import config
-from mailman.core.plugins import get_plugins
from mailman.interfaces.command import IEmailCommand
def initialize():
"""Initialize the email commands."""
- for module in get_plugins('mailman.commands'):
- for name in module.__all__:
+ for command_module in commands.__all__:
+ module_name = 'mailman.commands.' + command_module
+ __import__(module_name)
+ module = sys.modules[module_name]
+ for name in dir(module):
command_class = getattr(module, name)
- if not IEmailCommand.implementedBy(command_class):
+ try:
+ is_command = IEmailCommand.implementedBy(command_class)
+ except TypeError:
+ is_command = False
+ if not is_command:
continue
assert command_class.name not in config.commands, (
'Duplicate email command "{0}" found in {1}'.format(