[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mailman-cvs
Subject:    [Mailman-checkins] [Branch ~mailman-coders/mailman/3.0] Rev 6704:
From:       noreply () launchpad ! net
Date:       2009-03-10 4:10:16
Message-ID: 20090310041016.15373.68850.launchpad () loganberry ! canonical ! com
[Download RAW message or body]

------------------------------------------------------------
revno: 6704
committer: Barry Warsaw <barry@list.org>
branch nick: setup
timestamp: Mon 2009-03-09 23:42:21 -0400
message:
  Get rid of mailman.commands entry point.
modified:
  setup.py
  src/mailman/app/commands.py

=== modified file 'setup.py'
--- setup.py	2009-03-06 02:30:14 +0000
+++ setup.py	2009-03-10 03:42:21 +0000
@@ -65,13 +65,6 @@
     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 @@
     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',

=== modified file 'src/mailman/app/commands.py'
--- src/mailman/app/commands.py	2009-01-17 02:04:21 +0000
+++ src/mailman/app/commands.py	2009-03-10 03:42:21 +0000
@@ -25,18 +25,27 @@
     ]
 
 
+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(



--
Primary development focus
https://code.launchpad.net/~mailman-coders/mailman/3.0

Your team Mailman Checkins is subscribed to branch lp:mailman.
To unsubscribe from this branch go to \
https://code.launchpad.net/~mailman-coders/mailman/3.0/+edit-subscription. \
_______________________________________________ Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: http://mail.python.org/mailman/options/mailman-checkins/mailman-cvs%40progressive-comp.com



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic