Revision: 8082
          http://svn.sourceforge.net/mailman/?rev=8082&view=rev
Author:   msapiro
Date:     2006-10-23 20:55:24 -0700 (Mon, 23 Oct 2006)

Log Message:
-----------
Updated  the mmshell scripts so all use the configuration.py config object
instead of mm_cfg.py.  This involved mostly mechanical replacements, but
there were a few gotchas to make sure that various calls and assignments
that ultimately referenced the config were delayed until after the config
was loaded.

Updated configuration.py to throw an exception if config.load() is called
with a non-existent filename argument.

Updated loginit.py to add the fromusenet log used by gate_news.py.

Modified Paths:
--------------
    trunk/mailman/Mailman/bin/add_members.py
    trunk/mailman/Mailman/bin/arch.py
    trunk/mailman/Mailman/bin/bumpdigests.py
    trunk/mailman/Mailman/bin/change_pw.py
    trunk/mailman/Mailman/bin/checkdbs.py
    trunk/mailman/Mailman/bin/config_list.py
    trunk/mailman/Mailman/bin/disabled.py
    trunk/mailman/Mailman/bin/find_member.py
    trunk/mailman/Mailman/bin/gate_news.py
    trunk/mailman/Mailman/bin/list_members.py
    trunk/mailman/Mailman/bin/list_owners.py
    trunk/mailman/Mailman/bin/nightly_gzip.py
    trunk/mailman/Mailman/bin/senddigests.py
    trunk/mailman/Mailman/bin/show_qfiles.py
    trunk/mailman/Mailman/configuration.py
    trunk/mailman/Mailman/loginit.py

Modified: trunk/mailman/Mailman/bin/add_members.py
===================================================================
--- trunk/mailman/Mailman/bin/add_members.py    2006-10-23 19:41:42 UTC (rev 
8081)
+++ trunk/mailman/Mailman/bin/add_members.py    2006-10-24 03:55:24 UTC (rev 
8082)
@@ -26,8 +26,9 @@
 from Mailman import MailList
 from Mailman import Message
 from Mailman import Utils
+from Mailman import Version
 from Mailman import i18n
-from Mailman import mm_cfg
+from Mailman.configuration import config
 
 _ = i18n._
 __i18n_templates__ = True
@@ -35,7 +36,7 @@
 
 
 def parseargs():
-    parser = optparse.OptionParser(version=mm_cfg.MAILMAN_VERSION,
+    parser = optparse.OptionParser(version=Version.MAILMAN_VERSION,
                                    usage=_("""\
 %prog [options] listname
 
@@ -62,6 +63,8 @@
 Set whether or not to send the list administrators a notification on the
 success/failure of these subscriptions, overriding whatever the list's
 'admin_notify_mchanges' setting is."""))
+    parser.add_option('-C', '--config',
+                      help=_('Alternative configuration file to use'))
     opts, args = parser.parse_args()
     if not args:
         parser.print_help()
@@ -156,6 +159,7 @@
 
 def main():
     parser, opts, args = parseargs()
+    config.load(opts.config)
 
     listname = args[0].lower().strip()
     try:

Modified: trunk/mailman/Mailman/bin/arch.py
===================================================================
--- trunk/mailman/Mailman/bin/arch.py   2006-10-23 19:41:42 UTC (rev 8081)
+++ trunk/mailman/Mailman/bin/arch.py   2006-10-24 03:55:24 UTC (rev 8082)
@@ -22,21 +22,20 @@
 import optparse
 
 from Mailman import Errors
+from Mailman import Version
 from Mailman import i18n
-from Mailman import mm_cfg
 from Mailman.Archiver.HyperArch import HyperArchive
 from Mailman.LockFile import LockFile
 from Mailman.MailList import MailList
+from Mailman.configuration import config
 
 _ = i18n._
-i18n.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE)
-
 __i18n_templates__ = True
 
 
 
 def parseargs():
-    parser = optparse.OptionParser(version=mm_cfg.MAILMAN_VERSION,
+    parser = optparse.OptionParser(version=Version.MAILMAN_VERSION,
                                    usage=_("""\
 %%prog [options] listname [mbox]
 
@@ -73,6 +72,8 @@
 memory management, and for large archives, it may not be possible to index the
 mbox entirely.  For that reason, you can specify the start and end article
 numbers."""))
+    parser.add_option('-C', '--config',
+                      help=_('Alternative configuration file to use'))
     opts, args = parser.parse_args()
     if len(args) < 1:
         parser.print_help()
@@ -88,7 +89,10 @@
 
 def main():
     parser, opts, args = parseargs()
+    config.load(opts.config)
 
+    i18n.set_language(config.DEFAULT_SERVER_LANGUAGE)
+
     listname = args[0].lower().strip()
     if len(args) < 2:
         mbox = None
@@ -119,7 +123,7 @@
         # XXX This may not be necessary because I think we lay claim to the
         # list lock up above, although that may be too short to be of use (and
         # maybe we don't really want to lock the list anyway).
-        lockfile = os.path.join(mm_cfg.LOCK_DIR, mlist._internal_name) + \
+        lockfile = os.path.join(config.LOCK_DIR, mlist._internal_name) + \
                    '.archiver.lock'
         # set the lock lifetime to 3 hours.  XXX is this reasonable???
         lock = LockFile(lockfile, lifetime=3*60*60)

Modified: trunk/mailman/Mailman/bin/bumpdigests.py
===================================================================
--- trunk/mailman/Mailman/bin/bumpdigests.py    2006-10-23 19:41:42 UTC (rev 
8081)
+++ trunk/mailman/Mailman/bin/bumpdigests.py    2006-10-24 03:55:24 UTC (rev 
8082)
@@ -21,7 +21,8 @@
 from Mailman import Errors
 from Mailman import MailList
 from Mailman import Utils
-from Mailman import mm_cfg
+from Mailman import Version
+from Mailman.configuration import config
 from Mailman.i18n import _
 
 # Work around known problems with some RedHat cron daemons
@@ -33,13 +34,15 @@
 
 
 def parseargs():
-    parser = optparse.OptionParser(version=mm_cfg.MAILMAN_VERSION,
+    parser = optparse.OptionParser(version=Version.MAILMAN_VERSION,
                                    usage=_("""\
 %prog [options] [listname ...]
 
 Increment the digest volume number and reset the digest number to one.  All
 the lists named on the command line are bumped.  If no list names are given,
 all lists are bumped."""))
+    parser.add_option('-C', '--config',
+                      help=_('Alternative configuration file to use'))
     opts, args = parser.parse_args()
     return opts, args, parser
 
@@ -47,6 +50,7 @@
 
 def main():
     opts, args, parser = parseargs()
+    config.load(opts.config)
 
     listnames = set(args or Utils.list_names())
     if not listnames:

Modified: trunk/mailman/Mailman/bin/change_pw.py
===================================================================
--- trunk/mailman/Mailman/bin/change_pw.py      2006-10-23 19:41:42 UTC (rev 
8081)
+++ trunk/mailman/Mailman/bin/change_pw.py      2006-10-24 03:55:24 UTC (rev 
8082)
@@ -23,8 +23,9 @@
 from Mailman import MailList
 from Mailman import Message
 from Mailman import Utils
+from Mailman import Version
 from Mailman import i18n
-from Mailman import mm_cfg
+from Mailman.configuration import config
 
 _ = i18n._
 __i18n_templates__ = True
@@ -34,7 +35,7 @@
 
 
 def parseargs():
-    parser = optparse.OptionParser(version=mm_cfg.MAILMAN_VERSION,
+    parser = optparse.OptionParser(version=Version.MAILMAN_VERSION,
                                    usage=_("""\
 %%prog [options]
 
@@ -75,6 +76,8 @@
 Don't notify list owners of the new password.  You'll have to have some other
 way of letting the list owners know the new password (presumably
 out-of-band)."""))
+    parser.add_option('-C', '--config',
+                      help=_('Alternative configuration file to use'))
     opts, args = parser.parse_args()
     if args:
         parser.print_help()
@@ -107,6 +110,7 @@
 
 def main():
     parser, opts, args = parseargs()
+    config.load(opts.config)
 
     # Cull duplicates
     domains = set(opts.domains)
@@ -135,7 +139,7 @@
         try:
             if opts.password is None:
                 randompw = Utils.MakeRandomPassword(
-                    mm_cfg.ADMIN_PASSWORD_LENGTH)
+                    config.ADMIN_PASSWORD_LENGTH)
                 shapassword = sha.new(randompw).hexdigest()
                 notifypassword = randompw
             else:

Modified: trunk/mailman/Mailman/bin/checkdbs.py
===================================================================
--- trunk/mailman/Mailman/bin/checkdbs.py       2006-10-23 19:41:42 UTC (rev 
8081)
+++ trunk/mailman/Mailman/bin/checkdbs.py       2006-10-24 03:55:24 UTC (rev 
8082)
@@ -24,12 +24,11 @@
 from Mailman import MailList
 from Mailman import Message
 from Mailman import Utils
+from Mailman import Version
 from Mailman import i18n
-from Mailman import mm_cfg
+from Mailman.configuration import config
 
 _ = i18n._
-i18n.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE)
-
 __i18n_templates__ = True
 
 # Work around known problems with some RedHat cron daemons
@@ -42,11 +41,13 @@
 
 
 def parseargs():
-    parser = optparse.OptionParser(version=mm_cfg.MAILMAN_VERSION,
+    parser = optparse.OptionParser(version=Version.MAILMAN_VERSION,
                                    usage=_("""\
 %prog [options]
 
 Check for pending admin requests and mail the list owners if necessary."""))
+    parser.add_option('-C', '--config',
+                      help=_('Alternative configuration file to use'))
     opts, args = parser.parse_args()
     if args:
         parser.print_help()
@@ -113,12 +114,12 @@
 def auto_discard(mlist):
     # Discard old held messages
     discard_count = 0
-    expire = mm_cfg.days(mlist.max_days_to_hold)
+    expire = config.days(mlist.max_days_to_hold)
     heldmsgs = mlist.GetHeldMessageIds()
     if expire and heldmsgs:
         for id in heldmsgs:
             if now - mlist.GetRecord(id)[0] > expire:
-                mlist.HandleRequest(id, mm_cfg.DISCARD)
+                mlist.HandleRequest(id, config.DISCARD)
                 discard_count += 1
         mlist.Save()
     return discard_count
@@ -127,7 +128,10 @@
 
 def main():
     opts, args, parser = parseargs()
+    config.load(opts.config)
 
+    i18n.set_language(config.DEFAULT_SERVER_LANGUAGE)
+
     for name in Utils.list_names():
         # The list must be locked in order to open the requests database
         mlist = MailList.MailList(name)

Modified: trunk/mailman/Mailman/bin/config_list.py
===================================================================
--- trunk/mailman/Mailman/bin/config_list.py    2006-10-23 19:41:42 UTC (rev 
8081)
+++ trunk/mailman/Mailman/bin/config_list.py    2006-10-24 03:55:24 UTC (rev 
8082)
@@ -290,7 +290,7 @@
                     # one.  But we really do provide [0..3] so we need to undo
                     # the hack that _setValue adds. :( :(
                     if k == 'subscribe_policy' and \
-                           not mm_cfg.ALLOW_OPEN_SUBSCRIBE:
+                           not config.ALLOW_OPEN_SUBSCRIBE:
                         validval -= 1
                     # BAW: Another horrible hack.  This one is just too hard
                     # to fix in a principled way in Mailman 2.1
@@ -299,7 +299,7 @@
                         # transforms the value into a list of one item.
                         validval = validval[0]
                         validval = [bitfield for bitfield, bitval
-                                    in mm_cfg.OPTINFO.items()
+                                    in config.OPTINFO.items()
                                     if validval & bitval]
                     gui._setValue(mlist, k, validval, fakedoc)
             # BAW: when to do gui._postValidate()???

Modified: trunk/mailman/Mailman/bin/disabled.py
===================================================================
--- trunk/mailman/Mailman/bin/disabled.py       2006-10-23 19:41:42 UTC (rev 
8081)
+++ trunk/mailman/Mailman/bin/disabled.py       2006-10-24 03:55:24 UTC (rev 
8082)
@@ -24,9 +24,10 @@
 from Mailman import MemberAdaptor
 from Mailman import Pending
 from Mailman import Utils
+from Mailman import Version
 from Mailman import loginit
-from Mailman import mm_cfg
 from Mailman.Bouncer import _BounceInfo
+from Mailman.configuration import config
 from Mailman.i18n import _
 
 __i18n_templates__ = True
@@ -35,10 +36,6 @@
 import signal
 signal.signal(signal.SIGCHLD, signal.SIG_DFL)
 
-loginit.initialize(propagate=True)
-elog = logging.getLogger('mailman.error')
-blog = logging.getLogger('mailman.bounce')
-
 ALL = (MemberAdaptor.BYBOUNCE,
        MemberAdaptor.BYADMIN,
        MemberAdaptor.BYUSER,
@@ -62,7 +59,7 @@
 
 
 def parseargs():
-    parser = optparse.OptionParser(version=mm_cfg.MAILMAN_VERSION,
+    parser = optparse.OptionParser(version=Version.MAILMAN_VERSION,
                                    usage=_("""\
 %prog [options]
 
@@ -110,6 +107,8 @@
                       dest='listnames', action='append', default=[],
                       type='string', help=_("""\
 Process only the given list, otherwise do all lists."""))
+    parser.add_option('-C', '--config',
+                      help=_('Alternative configuration file to use'))
     opts, args = parser.parse_args()
     return opts, args, parser
 
@@ -117,7 +116,12 @@
 
 def main():
     opts, args, parser = parseargs()
+    config.load(opts.config)
 
+    loginit.initialize(propagate=True)
+    elog = logging.getLogger('mailman.error')
+    blog = logging.getLogger('mailman.bounce')
+
     listnames = set(opts.listnames or Utils.list_names())
     who = tuple(opts.who)
 

Modified: trunk/mailman/Mailman/bin/find_member.py
===================================================================
--- trunk/mailman/Mailman/bin/find_member.py    2006-10-23 19:41:42 UTC (rev 
8081)
+++ trunk/mailman/Mailman/bin/find_member.py    2006-10-24 03:55:24 UTC (rev 
8082)
@@ -22,7 +22,8 @@
 from Mailman import Errors
 from Mailman import MailList
 from Mailman import Utils
-from Mailman import mm_cfg
+from Mailman import Version
+from Mailman.configuration import config
 from Mailman.i18n import _
 
 
@@ -34,7 +35,7 @@
 
 
 def parseargs():
-    parser = optparse.OptionParser(version=mm_cfg.MAILMAN_VERSION,
+    parser = optparse.OptionParser(version=Version.MAILMAN_VERSION,
                                    usage=_("""\
 %prog [options] regex [regex ...]
 
@@ -63,20 +64,23 @@
     parser.add_option('-w', '--owners',
                       default=False, action='store_true',
                       help=_('Search list owners as well as members'))
+    parser.add_option('-C', '--config',
+                      help=_('Alternative configuration file to use'))
     opts, args = parser.parse_args()
     if not args:
         parser.print_help()
         print >> sys.stderr, _('Search regular expression required')
         sys.exit(1)
-    if not opts.listnames and opts.excludes:
-        opts.listnames = Utils.list_names()
     return parser, opts, args
 
 
 
 def main():
     parser, opts, args = parseargs()
+    config.load(opts.config)
 
+    if not opts.listnames:
+        opts.listnames = Utils.list_names()
     includes = set(listname.lower() for listname in opts.listnames)
     excludes = set(listname.lower() for listname in opts.excludes)
     listnames = includes - excludes

Modified: trunk/mailman/Mailman/bin/gate_news.py
===================================================================
--- trunk/mailman/Mailman/bin/gate_news.py      2006-10-23 19:41:42 UTC (rev 
8081)
+++ trunk/mailman/Mailman/bin/gate_news.py      2006-10-24 03:55:24 UTC (rev 
8082)
@@ -30,22 +30,19 @@
 from Mailman import MailList
 from Mailman import Message
 from Mailman import Utils
+from Mailman import Version
 from Mailman import loginit
-from Mailman import mm_cfg
 from Mailman.Queue.sbcache import get_switchboard
+from Mailman.configuration import config
 from Mailman.i18n import _
 
 # Work around known problems with some RedHat cron daemons
 import signal
 signal.signal(signal.SIGCHLD, signal.SIG_DFL)
 
-GATENEWS_LOCK_FILE = os.path.join(mm_cfg.LOCK_DIR, 'gate_news.lock')
-
-LOCK_LIFETIME = mm_cfg.hours(2)
 NL = '\n'
 
-loginit.initialize(propagate=True)
-log = logging.getLogger('mailman.fromusenet')
+log = None
 
 class _ContinueLoop(Exception):
     pass
@@ -55,11 +52,13 @@
 
 
 def parseargs():
-    parser = optparse.OptionParser(version=mm_cfg.MAILMAN_VERSION,
+    parser = optparse.OptionParser(version=Version.MAILMAN_VERSION,
                                    usage=_("""\
 %prog [options]
 
 Poll the NNTP servers for messages to be gatewayed to mailing lists."""))
+    parser.add_option('-C', '--config',
+                      help=_('Alternative configuration file to use'))
     opts, args = parser.parse_args()
     if args:
         parser.print_help()
@@ -81,8 +80,8 @@
         try:
             conn = nntplib.NNTP(nntp_host, nntp_port,
                                 readermode=True,
-                                user=mm_cfg.NNTP_USERNAME,
-                                password=mm_cfg.NNTP_PASSWORD)
+                                user=config.NNTP_USERNAME,
+                                password=config.NNTP_PASSWORD)
         except (socket.error, nntplib.NNTPError, IOError), e:
             log.error('error opening connection to nntp_host: %s\n%s',
                       mlist.nntp_host, e)
@@ -149,7 +148,7 @@
                     del msg['To']
                 msg['To'] = mlist.GetListEmail()
                 # Post the message to the locked list
-                inq = get_switchboard(mm_cfg.INQUEUE_DIR)
+                inq = get_switchboard(config.INQUEUE_DIR)
                 inq.enqueue(msg,
                             listname=mlist.internal_name(),
                             fromusenet=True)
@@ -186,7 +185,7 @@
         try:
             try:
                 if watermark is None:
-                    mlist.Lock(timeout=mm_cfg.LIST_LOCK_TIMEOUT)
+                    mlist.Lock(timeout=config.LIST_LOCK_TIMEOUT)
                     # This is the first time we've tried to gate this
                     # newsgroup.  We essentially do a mass catch-up, otherwise
                     # we'd flood the mailing list.
@@ -204,7 +203,7 @@
                     if start > last:
                         log.info('nothing new for list %s', listname)
                     else:
-                        mlist.Lock(timeout=mm_cfg.LIST_LOCK_TIMEOUT)
+                        mlist.Lock(timeout=config.LIST_LOCK_TIMEOUT)
                         log.info('gating %s articles [%d..%d]',
                                  listname, start, last)
                         # Use last+1 because poll_newsgroup() employes a for
@@ -223,6 +222,14 @@
 
 def main():
     opts, args, parser = parseargs()
+    config.load(opts.config)
+
+    GATENEWS_LOCK_FILE = os.path.join(config.LOCK_DIR, 'gate_news.lock')
+    LOCK_LIFETIME = config.hours(2)
+
+    loginit.initialize(propagate=True)
+    log = logging.getLogger('mailman.fromusenet')
+
     lock = LockFile.LockFile(GATENEWS_LOCK_FILE,
                              # It's okay to hijack this
                              lifetime=LOCK_LIFETIME)

Modified: trunk/mailman/Mailman/bin/list_members.py
===================================================================
--- trunk/mailman/Mailman/bin/list_members.py   2006-10-23 19:41:42 UTC (rev 
8081)
+++ trunk/mailman/Mailman/bin/list_members.py   2006-10-24 03:55:24 UTC (rev 
8082)
@@ -24,7 +24,8 @@
 from Mailman import MailList
 from Mailman import MemberAdaptor
 from Mailman import Utils
-from Mailman import mm_cfg
+from Mailman import Version
+from Mailman.configuration import config
 from Mailman.i18n import _
 
 __i18n_templates__ = True
@@ -45,7 +46,7 @@
 
 
 def parseargs():
-    parser = optparse.OptionParser(version=mm_cfg.MAILMAN_VERSION,
+    parser = optparse.OptionParser(version=Version.MAILMAN_VERSION,
                                    usage=_("""\
 %prog [options] listname
 
@@ -89,6 +90,8 @@
                       default=False, action='store_true', help=_("""\
 Print addresses which are stored as Unicode objects instead of normal string
 objects.  Ignores -r, -d, -n."""))
+    parser.add_option('-C', '--config',
+                      help=_('Alternative configuration file to use'))
     opts, args = parser.parse_args()
     if not args:
         parser.print_help()
@@ -154,6 +157,7 @@
 
 def main():
     parser, opts, args = parseargs()
+    config.load(opts.config)
 
     listname = args[0].lower().strip()
     if opts.output:
@@ -210,7 +214,7 @@
             if opts.nomail and not whymatches(mlist, addr, opts.why):
                 continue
             # Filter out digest kinds
-            if mlist.getMemberOption(addr, mm_cfg.DisableMime):
+            if mlist.getMemberOption(addr, config.DisableMime):
                 # They're getting plain text digests
                 if opts.kind == 'mime':
                     continue

Modified: trunk/mailman/Mailman/bin/list_owners.py
===================================================================
--- trunk/mailman/Mailman/bin/list_owners.py    2006-10-23 19:41:42 UTC (rev 
8081)
+++ trunk/mailman/Mailman/bin/list_owners.py    2006-10-24 03:55:24 UTC (rev 
8082)
@@ -19,8 +19,9 @@
 import optparse
 
 from Mailman import Utils
-from Mailman import mm_cfg
+from Mailman import Version
 from Mailman.MailList import MailList
+from Mailman.configuration import config
 from Mailman.i18n import _
 
 __i18n_templates__ = True
@@ -28,7 +29,7 @@
 
 
 def parseargs():
-    parser = optparse.OptionParser(version=mm_cfg.MAILMAN_VERSION,
+    parser = optparse.OptionParser(version=Version.MAILMAN_VERSION,
                                    usage=_("""\
 %prog [options] [listname ...]
 
@@ -43,6 +44,8 @@
     parser.add_option('-m', '--moderators',
                       default=False, action='store_true',
                       help=_('Include the list moderators in the output.'))
+    parser.add_option('-C', '--config',
+                      help=_('Alternative configuration file to use'))
     opts, args = parser.parse_args()
     return parser, opts, args
 
@@ -50,6 +53,7 @@
 
 def main():
     parser, opts, args = parseargs()
+    config.load(opts.config)
 
     listnames = args or Utils.list_names()
     bylist = {}

Modified: trunk/mailman/Mailman/bin/nightly_gzip.py
===================================================================
--- trunk/mailman/Mailman/bin/nightly_gzip.py   2006-10-23 19:41:42 UTC (rev 
8081)
+++ trunk/mailman/Mailman/bin/nightly_gzip.py   2006-10-24 03:55:24 UTC (rev 
8082)
@@ -26,9 +26,10 @@
 except ImportError:
     sys.exit(0)
 
-from Mailman import mm_cfg
+from Mailman import MailList
 from Mailman import Utils
-from Mailman import MailList
+from Mailman import Version
+from Mailman.configuration import config
 from Mailman.i18n import _
 
 __i18n_templates__ = True
@@ -36,7 +37,7 @@
 
 
 def parseargs():
-    parser = optparse.OptionParser(version=mm_cfg.MAILMAN_VERSION,
+    parser = optparse.OptionParser(version=Version.MAILMAN_VERSION,
                                    usage=_("""\
 %prog [options] [listname ...]
 
@@ -47,6 +48,8 @@
     parser.add_option('-z', '--level',
                       default=6, type='int',
                       help=_('Specifies the compression level'))
+    parser.add_option('-C', '--config',
+                      help=_('Alternative configuration file to use'))
     opts, args = parser.parse_args()
     if opts.level < 1 or opts.level > 9:
         parser.print_help()
@@ -73,15 +76,16 @@
 
 
 def main():
-    if mm_cfg.ARCHIVE_TO_MBOX not in (1, 2) or mm_cfg.GZIP_ARCHIVE_TXT_FILES:
+    opts, args, parser = parseargs()
+    config.load(opts.config)
+
+    if config.ARCHIVE_TO_MBOX not in (1, 2) or config.GZIP_ARCHIVE_TXT_FILES:
         # We're only going to run the nightly archiver if messages are
         # archived to the mbox, and the gzip file is not created on demand
         # (i.e. for every individual post).  This is the normal mode of
         # operation.
         return
 
-    opts, args, parser = parseargs()
-
     # Process all the specified lists
     for listname in set(args or Utils.list_names()):
         mlist = MailList.MailList(listname, lock=False)

Modified: trunk/mailman/Mailman/bin/senddigests.py
===================================================================
--- trunk/mailman/Mailman/bin/senddigests.py    2006-10-23 19:41:42 UTC (rev 
8081)
+++ trunk/mailman/Mailman/bin/senddigests.py    2006-10-24 03:55:24 UTC (rev 
8082)
@@ -20,7 +20,8 @@
 
 from Mailman import MailList
 from Mailman import Utils
-from Mailman import mm_cfg
+from Mailman import Version
+from Mailman.configuration import config
 from Mailman.i18n import _
 
 # Work around known problems with some RedHat cron daemons
@@ -32,7 +33,7 @@
 
 
 def parseargs():
-    parser = optparse.OptionParser(version=mm_cfg.MAILMAN_VERSION,
+    parser = optparse.OptionParser(version=Version.MAILMAN_VERSION,
                                    usage=_("""\
 %prog [options]
 
@@ -43,6 +44,8 @@
                       dest='listnames', help=_("""\
 Send the digest for the given list only, otherwise the digests for all
 lists are sent out.  Multiple -l options may be given."""))
+    parser.add_option('-C', '--config',
+                      help=_('Alternative configuration file to use'))
     opts, args = parser.parse_args()
     if args:
         parser.print_help()
@@ -54,6 +57,7 @@
 
 def main():
     opts, args, parser = parseargs()
+    config.load(opts.config)
 
     for listname in set(opts.listnames or Utils.list_names()):
         mlist = MailList.MailList(listname, lock=False)

Modified: trunk/mailman/Mailman/bin/show_qfiles.py
===================================================================
--- trunk/mailman/Mailman/bin/show_qfiles.py    2006-10-23 19:41:42 UTC (rev 
8081)
+++ trunk/mailman/Mailman/bin/show_qfiles.py    2006-10-24 03:55:24 UTC (rev 
8082)
@@ -19,7 +19,8 @@
 import optparse
 from cPickle import load
 
-from Mailman import mm_cfg
+from Mailman import Version
+from Mailman.configuration import config
 from Mailman.i18n import _
 
 __i18_templates__ = True
@@ -27,7 +28,7 @@
 
 
 def parseargs():
-    parser = optparse.OptionParser(version=mm_cfg.MAILMAN_VERSION,
+    parser = optparse.OptionParser(version=Version.MAILMAN_VERSION,
                                    usage=_("""\
 %%prog [options] qfiles ...
 
@@ -35,6 +36,8 @@
     parser.add_option('-q', '--quiet',
                       default=False, action='store_true',
                       help=_("Don't print 'helpful' message delimiters."))
+    parser.add_option('-C', '--config',
+                      help=_('Alternative configuration file to use'))
     opts, args = parser.parse_args()
     return parser, opts, args
 
@@ -42,6 +45,7 @@
 
 def main():
     parser, opts, args = parseargs()
+    config.load(opts.config)
 
     for filename in args:
         if not opts.quiet:

Modified: trunk/mailman/Mailman/configuration.py
===================================================================
--- trunk/mailman/Mailman/configuration.py      2006-10-23 19:41:42 UTC (rev 
8081)
+++ trunk/mailman/Mailman/configuration.py      2006-10-24 03:55:24 UTC (rev 
8082)
@@ -1,143 +1,144 @@
-# 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.
-        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:
-                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
+        # 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()
+

Modified: trunk/mailman/Mailman/loginit.py
===================================================================
--- trunk/mailman/Mailman/loginit.py    2006-10-23 19:41:42 UTC (rev 8081)
+++ trunk/mailman/Mailman/loginit.py    2006-10-24 03:55:24 UTC (rev 8082)
@@ -1,130 +1,132 @@
-# 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.
-
-"""Logging initialization, using Python's standard logging package.
-
-This module cannot be called 'logging' because that would interfere with the
-import below.  Ah, for Python 2.5 and absolute imports.
-"""
-
-import os
-import codecs
-import logging
-
-from Mailman.configuration import config
-
-FMT     = '%(asctime)s (%(process)d) %(message)s'
-DATEFMT = '%b %d %H:%M:%S %Y'
-LOGGERS = (
-    'bounce',
-    'config',
-    'debug',
-    'error',
-    'http',
-    'locks',
-    'mischief',
-    'post',
-    'qrunner',
-    'smtp',
-    'smtp-failure',
-    'subscribe',
-    'vette',
-    )
-
-_handlers = []
-
-
-
-class ReopenableFileHandler(logging.Handler):
-    def __init__(self, filename):
-        self._filename = filename
-        self._stream = self._open()
-        logging.Handler.__init__(self)
-
-    def _open(self):
-        return codecs.open(self._filename, 'a', 'utf-8')
-
-    def flush(self):
-        self._stream.flush()
-
-    def emit(self, record):
-        try:
-            msg = self.format(record)
-            fs = '%s\n'
-            try:
-                self._stream.write(fs % msg)
-            except UnicodeError:
-                self._stream.write(fs % msg.encode('string-escape'))
-            self.flush()
-        except:
-            self.handleError(record)
-
-    def close(self):
-        self.flush()
-        self._stream.close()
-        logging.Handler.close(self)
-
-    def reopen(self):
-        self._stream.close()
-        self._stream = self._open()
-
-
-
-def initialize(propagate=False):
-    # XXX Don't call logging.basicConfig() because in Python 2.3, it adds a
-    # handler to the root logger that we don't want.  When Python 2.4 is the
-    # minimum requirement, we can use basicConfig() with keyword arguments.
-    #
-    # The current set of Mailman logs are:
-    #
-    # error         - All exceptions go to this log
-    # bounce        - All bounce processing logs go here
-    # mischief      - Various types of hostile activity
-    # post          - Information about messages posted to mailing lists
-    # vette         - Information related to admindb activity
-    # smtp          - Successful SMTP activity
-    # smtp-failure  - Unsuccessful SMTP activity
-    # subscribe     - Information about leaves/joins
-    # config        - Configuration issues
-    # locks         - Lock steals
-    # qrunner       - qrunner start/stops
-    #
-    # There was also a 'debug' logger, but that was mostly unused, so instead
-    # we'll use debug level on existing loggers.
-    #
-    # Start by creating a common formatter and the root logger.
-    formatter = logging.Formatter(fmt=FMT, datefmt=DATEFMT)
-    log = logging.getLogger('mailman')
-    handler = logging.StreamHandler()
-    handler.setFormatter(formatter)
-    log.addHandler(handler)
-    log.setLevel(logging.INFO)
-    # Create the subloggers
-    for logger in LOGGERS:
-        log = logging.getLogger('mailman.' + logger)
-        # Propagation to the root logger is how we handle logging to stderr
-        # when the qrunners are not run as a subprocess of mailmanctl.
-        log.propagate = propagate
-        handler = ReopenableFileHandler(os.path.join(config.LOG_DIR, logger))
-        _handlers.append(handler)
-        handler.setFormatter(formatter)
-        log.addHandler(handler)
-
-
-
-def reopen():
-    for handler in _handlers:
-        handler.reopen()
+# 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.
+
+"""Logging initialization, using Python's standard logging package.
+
+This module cannot be called 'logging' because that would interfere with the
+import below.  Ah, for Python 2.5 and absolute imports.
+"""
+
+import os
+import codecs
+import logging
+
+from Mailman.configuration import config
+
+FMT     = '%(asctime)s (%(process)d) %(message)s'
+DATEFMT = '%b %d %H:%M:%S %Y'
+LOGGERS = (
+    'bounce',
+    'config',
+    'debug',
+    'error',
+    'fromusenet',
+    'http',
+    'locks',
+    'mischief',
+    'post',
+    'qrunner',
+    'smtp',
+    'smtp-failure',
+    'subscribe',
+    'vette',
+    )
+
+_handlers = []
+
+
+
+class ReopenableFileHandler(logging.Handler):
+    def __init__(self, filename):
+        self._filename = filename
+        self._stream = self._open()
+        logging.Handler.__init__(self)
+
+    def _open(self):
+        return codecs.open(self._filename, 'a', 'utf-8')
+
+    def flush(self):
+        self._stream.flush()
+
+    def emit(self, record):
+        try:
+            msg = self.format(record)
+            fs = '%s\n'
+            try:
+                self._stream.write(fs % msg)
+            except UnicodeError:
+                self._stream.write(fs % msg.encode('string-escape'))
+            self.flush()
+        except:
+            self.handleError(record)
+
+    def close(self):
+        self.flush()
+        self._stream.close()
+        logging.Handler.close(self)
+
+    def reopen(self):
+        self._stream.close()
+        self._stream = self._open()
+
+
+
+def initialize(propagate=False):
+    # XXX Don't call logging.basicConfig() because in Python 2.3, it adds a
+    # handler to the root logger that we don't want.  When Python 2.4 is the
+    # minimum requirement, we can use basicConfig() with keyword arguments.
+    #
+    # The current set of Mailman logs are:
+    #
+    # error         - All exceptions go to this log
+    # bounce        - All bounce processing logs go here
+    # mischief      - Various types of hostile activity
+    # post          - Information about messages posted to mailing lists
+    # vette         - Information related to admindb activity
+    # smtp          - Successful SMTP activity
+    # smtp-failure  - Unsuccessful SMTP activity
+    # subscribe     - Information about leaves/joins
+    # config        - Configuration issues
+    # locks         - Lock steals
+    # qrunner       - qrunner start/stops
+    # fromusenet    - Information related to the Usenet to Mailman gateway
+    #
+    # There was also a 'debug' logger, but that was mostly unused, so instead
+    # we'll use debug level on existing loggers.
+    #
+    # Start by creating a common formatter and the root logger.
+    formatter = logging.Formatter(fmt=FMT, datefmt=DATEFMT)
+    log = logging.getLogger('mailman')
+    handler = logging.StreamHandler()
+    handler.setFormatter(formatter)
+    log.addHandler(handler)
+    log.setLevel(logging.INFO)
+    # Create the subloggers
+    for logger in LOGGERS:
+        log = logging.getLogger('mailman.' + logger)
+        # Propagation to the root logger is how we handle logging to stderr
+        # when the qrunners are not run as a subprocess of mailmanctl.
+        log.propagate = propagate
+        handler = ReopenableFileHandler(os.path.join(config.LOG_DIR, logger))
+        _handlers.append(handler)
+        handler.setFormatter(formatter)
+        log.addHandler(handler)
+
+
+
+def reopen():
+    for handler in _handlers:
+        handler.reopen()


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