diff options
| author | Barry Warsaw | 2009-03-09 23:42:21 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2009-03-09 23:42:21 -0400 |
| commit | 11eb3395ad1f7c9f6699f96c33ca0543c2f83220 (patch) | |
| tree | 3cbf2f18672724fe454bec2dfc1e011748aa981a | |
| parent | f4975570e9c12670b92e3c55f01e31fa4a20879a (diff) | |
| download | mailman-11eb3395ad1f7c9f6699f96c33ca0543c2f83220.tar.gz mailman-11eb3395ad1f7c9f6699f96c33ca0543c2f83220.tar.zst mailman-11eb3395ad1f7c9f6699f96c33ca0543c2f83220.zip | |
Get rid of mailman.commands entry point.
| -rw-r--r-- | setup.py | 10 | ||||
| -rw-r--r-- | src/mailman/app/commands.py | 17 |
2 files changed, 14 insertions, 13 deletions
@@ -65,13 +65,6 @@ scripts = set( for script in mailman.bin.__all__ ) -# Default email commands -template = Template('$command = mailman.commands.$command') -commands = set( - template.substitute(command=command) - for command in mailman.commands.__all__ - ) - setup( @@ -92,8 +85,7 @@ case second `m'. Any other spelling is incorrect.""", package_dir = {'': 'src'}, include_package_data = True, entry_points = { - 'console_scripts': list(scripts), - 'mailman.commands' : list(commands), + 'console_scripts' : list(scripts), 'mailman.handlers' : 'default = mailman.pipeline:initialize', 'mailman.rules' : 'default = mailman.rules:initialize', 'mailman.scrubber' : 'stock = mailman.archiving.pipermail:Pipermail', 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( |
