Revision: 8086
          http://svn.sourceforge.net/mailman/?rev=8086&view=rev
Author:   bwarsaw
Date:     2006-11-04 13:05:32 -0800 (Sat, 04 Nov 2006)

Log Message:
-----------
Convert dumpdb to mmshell and configuration object.  Convert htmlformat.py
from mm_cfg to the configuration object.

In the config object, add an add_runner() function for extending the QRUNNERS
variable.

De-DOS-line-ending-ify configuration.py

Modified Paths:
--------------
    trunk/mailman/Mailman/MailList.py
    trunk/mailman/Mailman/bin/update.py
    trunk/mailman/Mailman/configuration.py
    trunk/mailman/Mailman/htmlformat.py
    trunk/mailman/bin/Makefile.in
    trunk/mailman/configure
    trunk/mailman/configure.in

Added Paths:
-----------
    trunk/mailman/Mailman/bin/dumpdb.py

Removed Paths:
-------------
    trunk/mailman/bin/dumpdb
    trunk/mailman/bin/update

Modified: trunk/mailman/Mailman/MailList.py
===================================================================
--- trunk/mailman/Mailman/MailList.py   2006-11-02 13:13:01 UTC (rev 8085)
+++ trunk/mailman/Mailman/MailList.py   2006-11-04 21:05:32 UTC (rev 8086)
@@ -45,6 +45,7 @@
 from Mailman import Errors
 from Mailman import LockFile
 from Mailman import Utils
+from Mailman import Version
 from Mailman.UserDesc import UserDesc
 from Mailman.configuration import config
 
@@ -740,7 +741,7 @@
     #
     def CheckVersion(self, stored_state):
         """Auto-update schema if necessary."""
-        if self.data_version >= config.DATA_FILE_VERSION:
+        if self.data_version >= Version.DATA_FILE_VERSION:
             return
         # Initialize any new variables
         self.InitVars()
@@ -755,7 +756,7 @@
         try:
             from versions import Update
             Update(self, stored_state)
-            self.data_version = config.DATA_FILE_VERSION
+            self.data_version = Version.DATA_FILE_VERSION
             self.Save()
         finally:
             if not waslocked:

Copied: trunk/mailman/Mailman/bin/dumpdb.py (from rev 8085, 
trunk/mailman/bin/dumpdb)
===================================================================
--- trunk/mailman/Mailman/bin/dumpdb.py                         (rev 0)
+++ trunk/mailman/Mailman/bin/dumpdb.py 2006-11-04 21:05:32 UTC (rev 8086)
@@ -0,0 +1,127 @@
+#! @PYTHON@
+#
+# Copyright (C) 1998-2006 by the Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+import sys
+import pprint
+import cPickle
+import marshal
+import optparse
+
+from Mailman import Version
+from Mailman.configuration import config
+from Mailman.i18n import _
+
+__i18n_templates__ = True
+
+COMMASPACE = ', '
+
+
+
+def parseargs():
+    parser = optparse.OptionParser(version=Version.MAILMAN_VERSION,
+                                   usage=_("""\
+%%prog [options] filename
+
+Dump the contents of any Mailman `database' file.
+
+If the filename ends with `.db', then it is assumed that the file contains a
+Python marshal.  If the file ends with `.pck' then it is assumed to contain a
+Python pickle.  In either case, if you want to override the default assumption
+-- or if the file ends in neither suffix -- use the -p or -m flags."""))
+    parser.add_option('-m', '--marshal',
+                      default=False, action='store_true',
+                      help=_("""\
+Assume the file contains a Python marshal,
+overridding any automatic guessing."""))
+    parser.add_option('-p', '--pickle',
+                      default=False, action='store_true',
+                      help=_("""\
+Assume the file contains a Python pickle,
+overridding any automatic guessing."""))
+    parser.add_option('-n', '--noprint',
+                      default=False, action='store_true',
+                      help=_("""\
+Don't attempt to pretty print the object.  This is useful if there's
+some problem with the object and you just want to get an unpickled
+representation.  Useful with `python -i bin/dumpdb <file>'.  In that
+case, the root of the tree will be left in a global called "msg"."""))
+    parser.add_option('-C', '--config',
+                      help=_('Alternative configuration file to use'))
+    opts, args = parser.parse_args()
+    # Options.
+    # None == guess, 0 == pickle, 1 == marshal
+    opts.filetype = None
+    if opts.pickle:
+        opts.filetype = 0
+    if opts.marshal:
+        opts.filetype = 1
+    opts.doprint = not opts.noprint
+    if len(args) < 1:
+        parser.error(_('No filename given.'))
+    elif len(args) > 1:
+        pargs = COMMASPACE.join(args)
+        parser.error(_('Bad arguments: $pargs'))
+    else:
+        opts.filename = args[0]
+    if opts.filetype is None:
+        if opts.filename.endswith('.db'):
+            opts.filetype = 1
+        elif opts.filename.endswith('.pck'):
+            opts.filetype = 0
+        else:
+            parser.error(_('Please specify either -p or -m.'))
+    return parser, opts, args
+
+
+
+def main():
+    parser, opts, args = parseargs()
+    config.load(opts.config)
+
+    # Handle dbs
+    pp = pprint.PrettyPrinter(indent=4)
+    if opts.filetype == 1:
+        load = marshal.load
+        typename = 'marshal'
+    else:
+        load = cPickle.load
+        typename = 'pickle'
+    fp = open(opts.filename)
+    m = []
+    try:
+        cnt = 1
+        if opts.doprint:
+            print _('[----- start $typename file -----]')
+        while True:
+            try:
+                obj = load(fp)
+            except EOFError:
+                if opts.doprint:
+                    print _('[----- end $typename file -----]')
+                break
+            if opts.doprint:
+                print _('<----- start object $cnt ----->')
+                if isinstance(obj, str):
+                    print obj
+                else:
+                    pp.pprint(obj)
+            cnt += 1
+            m.append(obj)
+    finally:
+        fp.close()

Modified: trunk/mailman/Mailman/bin/update.py
===================================================================
--- trunk/mailman/Mailman/bin/update.py 2006-11-02 13:13:01 UTC (rev 8085)
+++ trunk/mailman/Mailman/bin/update.py 2006-11-04 21:05:32 UTC (rev 8086)
@@ -76,7 +76,7 @@
     #
     # See if we stored the last updated version
     lastversion = None
-    thisversion = config.HEX_VERSION
+    thisversion = Version.HEX_VERSION
     try:
         fp = open(os.path.join(config.DATA_DIR, 'last_mailman_version'))
         data = fp.read()

Modified: trunk/mailman/Mailman/configuration.py
===================================================================
--- trunk/mailman/Mailman/configuration.py      2006-11-02 13:13:01 UTC (rev 
8085)
+++ trunk/mailman/Mailman/configuration.py      2006-11-04 21:05:32 UTC (rev 
8086)
@@ -1,144 +1,155 @@
-# Copyright (C) 2006 by the Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-# USA.
-
-"""Configuration file loading and management."""
-
-import os
-import errno
-
-from Mailman import Defaults
-from Mailman import Errors
-
-_missing = object()
-
-
-
-class Configuration(object):
-    def __init__(self):
-        self.domains = {}       # email host -> web host
-        self._reverse = None
-
-    def load(self, filename=None):
-        # Load the configuration from the named file, or if not given, search
-        # in VAR_PREFIX for an etc/mailman.cfg file.  If that file is missing,
-        # use Mailman/mm_cfg.py for backward compatibility.
-        #
-        # Whatever you find, create a namespace and execfile that file in it.
-        # The values in that namespace are exposed as attributes on this
-        # Configuration instance.
-        original_filename = filename
-        if filename is None:
-            filename = os.path.join(Defaults.VAR_PREFIX, 'etc', 'mailman.cfg')
-        # Set up the execfile namespace
-        ns = Defaults.__dict__.copy()
-        # Prune a few things, add a few things
-        del ns['__file__']
-        del ns['__name__']
-        del ns['__doc__']
-        ns['add_domain'] = self.add_domain
-        # Attempt our first choice
-        path = os.path.abspath(os.path.expanduser(filename))
-        try:
-            execfile(path, ns, ns)
-        except EnvironmentError, e:
-            if e.errno <> errno.ENOENT or original_filename:
-                raise
-            # The file didn't exist, so try mm_cfg.py
-            from Mailman import mm_cfg
-            ns.update(mm_cfg.__dict__)
-        # Pull out the defaults
-        PREFIX          = ns['PREFIX']
-        VAR_PREFIX      = ns['VAR_PREFIX']
-        EXEC_PREFIX     = ns['EXEC_PREFIX']
-        # Now that we've loaded all the configuration files we're going to
-        # load, set up some useful directories.
-        self.LIST_DATA_DIR      = os.path.join(VAR_PREFIX, 'lists')
-        self.LOG_DIR            = os.path.join(VAR_PREFIX, 'logs')
-        self.LOCK_DIR = lockdir = os.path.join(VAR_PREFIX, 'locks')
-        self.DATA_DIR = datadir = os.path.join(VAR_PREFIX, 'data')
-        self.ETC_DIR = etcdir   = os.path.join(VAR_PREFIX, 'etc')
-        self.SPAM_DIR           = os.path.join(VAR_PREFIX, 'spam')
-        self.WRAPPER_DIR        = os.path.join(EXEC_PREFIX, 'mail')
-        self.BIN_DIR            = os.path.join(PREFIX, 'bin')
-        self.SCRIPTS_DIR        = os.path.join(PREFIX, 'scripts')
-        self.TEMPLATE_DIR       = os.path.join(PREFIX, 'templates')
-        self.MESSAGES_DIR       = os.path.join(PREFIX, 'messages')
-        self.PUBLIC_ARCHIVE_FILE_DIR  = os.path.join(VAR_PREFIX,
-                                                     'archives', 'public')
-        self.PRIVATE_ARCHIVE_FILE_DIR = os.path.join(VAR_PREFIX,
-                                                     'archives', 'private')
-        # Directories used by the qrunner subsystem
-        self.QUEUE_DIR = qdir   = os.path.join(VAR_PREFIX, 'qfiles')
-        self.INQUEUE_DIR        = os.path.join(qdir, 'in')
-        self.OUTQUEUE_DIR       = os.path.join(qdir, 'out')
-        self.CMDQUEUE_DIR       = os.path.join(qdir, 'commands')
-        self.BOUNCEQUEUE_DIR    = os.path.join(qdir, 'bounces')
-        self.NEWSQUEUE_DIR      = os.path.join(qdir, 'news')
-        self.ARCHQUEUE_DIR      = os.path.join(qdir, 'archive')
-        self.SHUNTQUEUE_DIR     = os.path.join(qdir, 'shunt')
-        self.VIRGINQUEUE_DIR    = os.path.join(qdir, 'virgin')
-        self.BADQUEUE_DIR       = os.path.join(qdir, 'bad')
-        self.RETRYQUEUE_DIR     = os.path.join(qdir, 'retry')
-        self.MAILDIR_DIR        = os.path.join(qdir, 'maildir')
-        # Other useful files
-        self.PIDFILE                = os.path.join(datadir,
-                                                   'master-qrunner.pid')
-        self.SITE_PW_FILE           = os.path.join(datadir, 'adm.pw')
-        self.LISTCREATOR_PW_FILE    = os.path.join(datadir, 'creator.pw')
-        self.CONFIG_FILE            = os.path.join(etcdir, 'mailman.cfg')
-        self.LOCK_FILE              = os.path.join(lockdir, 'master-qrunner')
-        # Now update our dict so attribute syntax just works
-        if 'add_domain' in ns:
-            del ns['add_domain']
-        self.__dict__.update(ns)
-        # Add the default domain if there are no virtual domains currently
-        # defined.
-        if not self.domains:
-            self.add_domain(self.DEFAULT_EMAIL_HOST, self.DEFAULT_URL_HOST)
-
-    def add_domain(self, email_host, url_host):
-        """Add the definition of a virtual domain.
-
-        email_host is the right-hand side of the posting email address,
-        e.g. 'example.com' in '[EMAIL PROTECTED]'.  url_host is the host name
-        part of the exposed web pages, e.g. 'www.example.com'."""
-        if email_host in self.domains:
-            raise Errors.BadDomainSpecificationError(
-                'Duplicate email host: %s' % email_host)
-        # Make sure there's only one mapping for the url_host
-        if url_host in self.domains.values():
-            raise Errors.BadDomainSpecificationError(
-                'Duplicate url host: %s' % url_host)
-        # We'll do the reverse mappings on-demand.  There shouldn't be too
-        # many virtual hosts that it will really matter that much.
-        self.domains[email_host] = url_host
-        # Invalidate the reverse mapping cache
-        self._reverse = None
-
-    # Given an email host name, the url host name can be looked up directly.
-    # This does the reverse mapping.
-    def get_email_host(self, url_host, default=None):
-        if self._reverse is None:
-            # XXX Can't use a generator comprehension until Python 2.4 is
-            # minimum requirement.
-            self._reverse = dict([(v, k) for k, v in self.domains.items()])
-        return self._reverse.get(url_host, default)
-
-
-
-config = Configuration()
-
+# Copyright (C) 2006 by the Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+"""Configuration file loading and management."""
+
+import os
+import errno
+
+from Mailman import Defaults
+from Mailman import Errors
+
+_missing = object()
+
+
+
+class Configuration(object):
+    def __init__(self):
+        self.domains = {}       # email host -> web host
+        self._reverse = None
+
+    def load(self, filename=None):
+        # Load the configuration from the named file, or if not given, search
+        # in VAR_PREFIX for an etc/mailman.cfg file.  If that file is missing,
+        # use Mailman/mm_cfg.py for backward compatibility.
+        #
+        # Whatever you find, create a namespace and execfile that file in it.
+        # The values in that namespace are exposed as attributes on this
+        # Configuration instance.
+        original_filename = filename
+        if filename is None:
+            filename = os.path.join(Defaults.VAR_PREFIX, 'etc', 'mailman.cfg')
+        # Set up the execfile namespace
+        ns = Defaults.__dict__.copy()
+        # Prune a few things, add a few things
+        del ns['__file__']
+        del ns['__name__']
+        del ns['__doc__']
+        ns['add_domain'] = self.add_domain
+        ns['add_runner'] = self.add_runner
+        # Attempt our first choice
+        path = os.path.abspath(os.path.expanduser(filename))
+        try:
+            execfile(path, ns, ns)
+        except EnvironmentError, e:
+            if e.errno <> errno.ENOENT or original_filename:
+                raise
+            # The file didn't exist, so try mm_cfg.py
+            from Mailman import mm_cfg
+            ns.update(mm_cfg.__dict__)
+        # Pull out the defaults
+        PREFIX          = ns['PREFIX']
+        VAR_PREFIX      = ns['VAR_PREFIX']
+        EXEC_PREFIX     = ns['EXEC_PREFIX']
+        # Now that we've loaded all the configuration files we're going to
+        # load, set up some useful directories.
+        self.LIST_DATA_DIR      = os.path.join(VAR_PREFIX, 'lists')
+        self.LOG_DIR            = os.path.join(VAR_PREFIX, 'logs')
+        self.LOCK_DIR = lockdir = os.path.join(VAR_PREFIX, 'locks')
+        self.DATA_DIR = datadir = os.path.join(VAR_PREFIX, 'data')
+        self.ETC_DIR = etcdir   = os.path.join(VAR_PREFIX, 'etc')
+        self.SPAM_DIR           = os.path.join(VAR_PREFIX, 'spam')
+        self.WRAPPER_DIR        = os.path.join(EXEC_PREFIX, 'mail')
+        self.BIN_DIR            = os.path.join(PREFIX, 'bin')
+        self.SCRIPTS_DIR        = os.path.join(PREFIX, 'scripts')
+        self.TEMPLATE_DIR       = os.path.join(PREFIX, 'templates')
+        self.MESSAGES_DIR       = os.path.join(PREFIX, 'messages')
+        self.PUBLIC_ARCHIVE_FILE_DIR  = os.path.join(VAR_PREFIX,
+                                                     'archives', 'public')
+        self.PRIVATE_ARCHIVE_FILE_DIR = os.path.join(VAR_PREFIX,
+                                                     'archives', 'private')
+        # Directories used by the qrunner subsystem
+        self.QUEUE_DIR = qdir   = os.path.join(VAR_PREFIX, 'qfiles')
+        self.INQUEUE_DIR        = os.path.join(qdir, 'in')
+        self.OUTQUEUE_DIR       = os.path.join(qdir, 'out')
+        self.CMDQUEUE_DIR       = os.path.join(qdir, 'commands')
+        self.BOUNCEQUEUE_DIR    = os.path.join(qdir, 'bounces')
+        self.NEWSQUEUE_DIR      = os.path.join(qdir, 'news')
+        self.ARCHQUEUE_DIR      = os.path.join(qdir, 'archive')
+        self.SHUNTQUEUE_DIR     = os.path.join(qdir, 'shunt')
+        self.VIRGINQUEUE_DIR    = os.path.join(qdir, 'virgin')
+        self.BADQUEUE_DIR       = os.path.join(qdir, 'bad')
+        self.RETRYQUEUE_DIR     = os.path.join(qdir, 'retry')
+        self.MAILDIR_DIR        = os.path.join(qdir, 'maildir')
+        # Other useful files
+        self.PIDFILE                = os.path.join(datadir,
+                                                   'master-qrunner.pid')
+        self.SITE_PW_FILE           = os.path.join(datadir, 'adm.pw')
+        self.LISTCREATOR_PW_FILE    = os.path.join(datadir, 'creator.pw')
+        self.CONFIG_FILE            = os.path.join(etcdir, 'mailman.cfg')
+        self.LOCK_FILE              = os.path.join(lockdir, 'master-qrunner')
+        # Now update our dict so attribute syntax just works
+        if 'add_domain' in ns:
+            del ns['add_domain']
+        if 'add_runner' in ns:
+            del ns['add_runner']
+        self.__dict__.update(ns)
+        # Add the default domain if there are no virtual domains currently
+        # defined.
+        if not self.domains:
+            self.add_domain(self.DEFAULT_EMAIL_HOST, self.DEFAULT_URL_HOST)
+
+    def add_domain(self, email_host, url_host):
+        """Add the definition of a virtual domain.
+
+        email_host is the right-hand side of the posting email address,
+        e.g. 'example.com' in '[EMAIL PROTECTED]'.  url_host is the host name
+        part of the exposed web pages, e.g. 'www.example.com'."""
+        if email_host in self.domains:
+            raise Errors.BadDomainSpecificationError(
+                'Duplicate email host: %s' % email_host)
+        # Make sure there's only one mapping for the url_host
+        if url_host in self.domains.values():
+            raise Errors.BadDomainSpecificationError(
+                'Duplicate url host: %s' % url_host)
+        # We'll do the reverse mappings on-demand.  There shouldn't be too
+        # many virtual hosts that it will really matter that much.
+        self.domains[email_host] = url_host
+        # Invalidate the reverse mapping cache
+        self._reverse = None
+
+    # Given an email host name, the url host name can be looked up directly.
+    # This does the reverse mapping.
+    def get_email_host(self, url_host, default=None):
+        if self._reverse is None:
+            # XXX Can't use a generator comprehension until Python 2.4 is
+            # minimum requirement.
+            self._reverse = dict([(v, k) for k, v in self.domains.items()])
+        return self._reverse.get(url_host, default)
+
+    def add_runner(self, name, count=1):
+        """Convenient interface for adding additional qrunners.
+
+        name is the qrunner name, and must include the 'Runner' suffix.
+        E.g. 'HTTPRunner' or 'LMTPRunner'.  count is the number of qrunner
+        slices to create, by default, 1.
+        """
+        self.QRUNNERS.append((name, count))
+
+
+
+config = Configuration()

Modified: trunk/mailman/Mailman/htmlformat.py
===================================================================
--- trunk/mailman/Mailman/htmlformat.py 2006-11-02 13:13:01 UTC (rev 8085)
+++ trunk/mailman/Mailman/htmlformat.py 2006-11-04 21:05:32 UTC (rev 8086)
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2005 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2006 by the Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
@@ -12,23 +12,19 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 
USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+# USA.
 
-
 """Library for program-based construction of an HTML documents.
 
 Encapsulate HTML formatting directives in classes that act as containers
 for python and, recursively, for nested HTML formatting objects.
 """
 
-
-# Eventually could abstract down to HtmlItem, which outputs an arbitrary html
-# object given start / end tags, valid options, and a value.  Ug, objects
-# shouldn't be adding their own newlines.  The next object should.
-
-
-from Mailman import mm_cfg
+from Mailman import Defaults
 from Mailman import Utils
+from Mailman import Version
+from Mailman.configuration import config
 from Mailman.i18n import _
 
 SPACE = ' '
@@ -281,7 +277,7 @@
 class Document(Container):
     title = None
     language = None
-    bgcolor = mm_cfg.WEB_BG_COLOR
+    bgcolor = Defaults.WEB_BG_COLOR
     suppress_head = 0
 
     def set_language(self, lang=None):
@@ -305,9 +301,9 @@
                            '<HTML>',
                            '<HEAD>'
                            ])
-            if mm_cfg.IMAGE_LOGOS:
+            if config.IMAGE_LOGOS:
                 output.append('<LINK REL="SHORTCUT ICON" HREF="%s">' %
-                              (mm_cfg.IMAGE_LOGOS + mm_cfg.SHORTCUT_ICON))
+                              (config.IMAGE_LOGOS + config.SHORTCUT_ICON))
             # Hit all the bases
             output.append('<META http-equiv="Content-Type" '
                           'content="text/html; charset=%s">' % charset)
@@ -316,12 +312,12 @@
             output.append('%s</HEAD>' % tab)
             quals = []
             # Default link colors
-            if mm_cfg.WEB_VLINK_COLOR:
-                kws.setdefault('vlink', mm_cfg.WEB_VLINK_COLOR)
-            if mm_cfg.WEB_ALINK_COLOR:
-                kws.setdefault('alink', mm_cfg.WEB_ALINK_COLOR)
-            if mm_cfg.WEB_LINK_COLOR:
-                kws.setdefault('link', mm_cfg.WEB_LINK_COLOR)
+            if config.WEB_VLINK_COLOR:
+                kws.setdefault('vlink', config.WEB_VLINK_COLOR)
+            if config.WEB_ALINK_COLOR:
+                kws.setdefault('alink', config.WEB_ALINK_COLOR)
+            if config.WEB_LINK_COLOR:
+                kws.setdefault('link', config.WEB_LINK_COLOR)
             for k, v in kws.items():
                 quals.append('%s="%s"' % (k, v))
             output.append('%s<BODY %s>' % (tab, SPACE.join(quals)))
@@ -336,7 +332,7 @@
         if tag is None:
             tag = _('Error: ')
         self.AddItem(Header(3, Bold(FontAttr(
-            _(tag), color=mm_cfg.WEB_ERROR_COLOR, size='+2')).Format() +
+            _(tag), color=config.WEB_ERROR_COLOR, size='+2')).Format() +
                             Italic(errmsg).Format()))
 
 
@@ -441,11 +437,11 @@
         InputObj.__init__(self, name, "SUBMIT", button_text, checked=0)
 
 class PasswordBox(InputObj):
-    def __init__(self, name, value='', size=mm_cfg.TEXTFIELDWIDTH):
+    def __init__(self, name, value='', size=Defaults.TEXTFIELDWIDTH):
         InputObj.__init__(self, name, "PASSWORD", value, checked=0, size=size)
 
 class TextBox(InputObj):
-    def __init__(self, name, value='', size=mm_cfg.TEXTFIELDWIDTH):
+    def __init__(self, name, value='', size=Defaults.TEXTFIELDWIDTH):
         InputObj.__init__(self, name, "TEXT", value, checked=0, size=size)
 
 class Hidden(InputObj):
@@ -594,13 +590,12 @@
 #
 # These are the URLs which the image logos link to.  The Mailman home page now
 # points at the gnu.org site instead of the www.list.org mirror.
-#
-from mm_cfg import MAILMAN_URL
+
 PYTHON_URL  = 'http://www.python.org/'
 GNU_URL     = 'http://www.gnu.org/'
 
 # The names of the image logo files.  These are concatentated onto
-# mm_cfg.IMAGE_LOGOS (not urljoined).
+# config.IMAGE_LOGOS (not urljoined).
 DELIVERED_BY = 'mailman.jpg'
 PYTHON_POWERED = 'PythonPowered.png'
 GNU_HEAD = 'gnu-head-tiny.jpg'
@@ -608,11 +603,11 @@
 
 def MailmanLogo():
     t = Table(border=0, width='100%')
-    if mm_cfg.IMAGE_LOGOS:
+    if config.IMAGE_LOGOS:
         def logo(file):
-            return mm_cfg.IMAGE_LOGOS + file
+            return config.IMAGE_LOGOS + file
         mmlink = '<img src="%s" alt="Delivered by Mailman" border=0>' \
-                 '<br>version %s' % (logo(DELIVERED_BY), mm_cfg.VERSION)
+                 '<br>version %s' % (logo(DELIVERED_BY), Version.VERSION)
         pylink = '<img src="%s" alt="Python Powered" border=0>' % \
                  logo(PYTHON_POWERED)
         gnulink = '<img src="%s" alt="GNU\'s Not Unix" border=0>' % \
@@ -620,8 +615,8 @@
         t.AddRow([mmlink, pylink, gnulink])
     else:
         # use only textual links
-        version = mm_cfg.VERSION
-        mmlink = Link(MAILMAN_URL,
+        version = Version.VERSION
+        mmlink = Link(config.MAILMAN_URL,
                       _('Delivered by Mailman<br>version %(version)s'))
         pylink = Link(PYTHON_URL, _('Python Powered'))
         gnulink = Link(GNU_URL, _("Gnu's Not Unix"))

Modified: trunk/mailman/bin/Makefile.in
===================================================================
--- trunk/mailman/bin/Makefile.in       2006-11-02 13:13:01 UTC (rev 8085)
+++ trunk/mailman/bin/Makefile.in       2006-11-04 21:05:32 UTC (rev 8086)
@@ -47,13 +47,13 @@
 SCRIPTS=       mmshell \
                remove_members clone_member \
                sync_members check_db withlist \
-               dumpdb cleanarch \
+               cleanarch \
                list_admins \
                fix_url.py convert.py transcheck \
                msgfmt.py discard \
                reset_pw.py templ2pot.py po2templ.py
 
-LN_SCRIPTS=    add_members arch change_pw check_perms config_list \
+LN_SCRIPTS=    add_members arch change_pw check_perms config_list dumpdb \
                export find_member genaliases import inject list_lists \
                list_members list_owners mailmanctl mmsitepass newlist \
                qrunner rmlist show_config show_qfiles testall unshunt \

Deleted: trunk/mailman/bin/dumpdb
===================================================================
--- trunk/mailman/bin/dumpdb    2006-11-02 13:13:01 UTC (rev 8085)
+++ trunk/mailman/bin/dumpdb    2006-11-04 21:05:32 UTC (rev 8086)
@@ -1,137 +0,0 @@
-#! @PYTHON@
-#
-# Copyright (C) 1998-2006 by the Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 
USA.
-
-import sys
-import pprint
-import cPickle
-import marshal
-import optparse
-
-import paths
-
-from Mailman import mm_cfg
-from Mailman.i18n import _
-__i18n_templates__ = True
-
-
-
-COMMASPACE = ', '
-
-def parseargs():
-    parser = optparse.OptionParser(version=mm_cfg.MAILMAN_VERSION,
-                                   usage=_("""\
-%%prog [options] filename
-
-Dump the contents of any Mailman `database' file.
-
-If the filename ends with `.db', then it is assumed that the file contains a
-Python marshal.  If the file ends with `.pck' then it is assumed to contain a
-Python pickle.  In either case, if you want to override the default assumption
--- or if the file ends in neither suffix -- use the -p or -m flags."""))
-    parser.add_option('-m', '--marshal',
-                      default=False, action='store_true',
-                      help=_("""\
-Assume the file contains a Python marshal,
-overridding any automatic guessing."""))
-    parser.add_option('-p', '--pickle',
-                      default=False, action='store_true',
-                      help=_("""\
-Assume the file contains a Python pickle,
-overridding any automatic guessing."""))
-    parser.add_option('-n', '--noprint',
-                      default=False, action='store_true',
-                      help=_("""\
-Don't attempt to pretty print the object.  This is useful if there's
-some problem with the object and you just want to get an unpickled
-representation.  Useful with `python -i bin/dumpdb <file>'.  In that
-case, the root of the tree will be left in a global called "msg"."""))
-    opts, args = parser.parse_args()
-    # Options.
-    # None == guess, 0 == pickle, 1 == marshal
-    opts.filetype = None
-    if opts.pickle:
-        opts.filetype = 0
-    if opts.marshal:
-        opts.filetype = 1
-    opts.doprint = not opts.noprint
-    if len(args) < 1:
-        parser.print_help()
-        print >> sys.stderr, _('No filename given.')
-        sys.exit(1)
-    elif len(args) > 1:
-        parser.print_help()
-        pargs = COMMASPACE.join(args)
-        print >> sys.stderr, _('Bad arguments: $pargs')
-        sys.exit(1)
-    else:
-        opts.filename = args[0]
-    if opts.filetype is None:
-        if opts.filename.endswith('.db'):
-            opts.filetype = 1
-        elif opts.filename.endswith('.pck'):
-            opts.filetype = 0
-        else:
-            parser.print_help()
-            print >> sys.stderr, _('Please specify either -p or -m.')
-            sys.exit(1)
-    return parser, opts, args
-
-
-
-def main():
-    parser, opts, args = parseargs()
-
-    # Handle dbs
-    pp = pprint.PrettyPrinter(indent=4)
-    if opts.filetype == 1:
-        # BAW: this probably doesn't work if there are mixed types of .db
-        # files (i.e. some marshals, some bdbs).
-        load = marshal.load
-        typename = 'marshal'
-    else:
-        load = cPickle.load
-        typename = 'pickle'
-    fp = open(opts.filename)
-    m = []
-    try:
-        cnt = 1
-        if opts.doprint:
-            print _('[----- start $typename file -----]')
-        while True:
-            try:
-                obj = load(fp)
-            except EOFError:
-                if opts.doprint:
-                    print _('[----- end $typename file -----]')
-                break
-            if opts.doprint:
-                print _('<----- start object $cnt ----->')
-                if isinstance(obj, str):
-                    print obj
-                else:
-                    pp.pprint(obj)
-            cnt += 1
-            m.append(obj)
-    finally:
-        fp.close()
-    return m
-
-
-
-if __name__ == '__main__':
-    msg = main()

Deleted: trunk/mailman/bin/update
===================================================================

Modified: trunk/mailman/configure
===================================================================
--- trunk/mailman/configure     2006-11-02 13:13:01 UTC (rev 8085)
+++ trunk/mailman/configure     2006-11-04 21:05:32 UTC (rev 8086)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 8040 .
+# From configure.in Revision: 8051 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.59 for GNU Mailman 2.2.0a0.
 #
@@ -4289,7 +4289,6 @@
 build/bin/clone_member:bin/clone_member \
 build/bin/convert.py:bin/convert.py \
 build/bin/discard:bin/discard \
-build/bin/dumpdb:bin/dumpdb \
 build/bin/fix_url.py:bin/fix_url.py \
 build/bin/list_admins:bin/list_admins \
 build/bin/mmshell:bin/mmshell \

Modified: trunk/mailman/configure.in
===================================================================
--- trunk/mailman/configure.in  2006-11-02 13:13:01 UTC (rev 8085)
+++ trunk/mailman/configure.in  2006-11-04 21:05:32 UTC (rev 8086)
@@ -597,7 +597,6 @@
 bin/clone_member \
 bin/convert.py \
 bin/discard \
-bin/dumpdb \
 bin/fix_url.py \
 bin/list_admins \
 bin/mmshell \


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to