summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbwarsaw2006-08-29 02:58:35 +0000
committerbwarsaw2006-08-29 02:58:35 +0000
commit85eba63c38c990f4b5687fb8f6693c0778444fa1 (patch)
tree1f615f474424c5d33e09d7ae568da72bec00acde
parent391c15b319a2d310c79a595f3a4d639607453012 (diff)
downloadmailman-85eba63c38c990f4b5687fb8f6693c0778444fa1.tar.gz
mailman-85eba63c38c990f4b5687fb8f6693c0778444fa1.tar.zst
mailman-85eba63c38c990f4b5687fb8f6693c0778444fa1.zip
Fix several problems reported by Mark. First, Python 2.3 doesn't have
built-in sets and sadly we still have to support it. Utils.list_names() therefore now uses a sets.Set if it finds the built-in set type missing. main() in list_lists.py also has to list()-ify the set in order to sort it. There's a bootstrapping problem when bin/update tries to re-situate a non-qualified list name to a qualified list name. The problem is that the MailList ctor will call Load() with the nonqual name, which in turn will call CheckVersion() by default. The latter will then turn around and try to call Load() with the fqdn list name, but that list name won't yet exist since it hasn't been situated. The solution (but maybe not the best one) then is to pass the check_version flag to the MailList ctor, which gets passed down to the Load() call. Only situate_list() will call this to avoid the version checking before the list has been situated.
-rw-r--r--Mailman/MailList.py4
-rw-r--r--Mailman/Utils.py7
-rw-r--r--Mailman/bin/list_lists.py2
-rw-r--r--Mailman/bin/update.py6
4 files changed, 13 insertions, 6 deletions
diff --git a/Mailman/MailList.py b/Mailman/MailList.py
index c834ab9c6..dcf70a94a 100644
--- a/Mailman/MailList.py
+++ b/Mailman/MailList.py
@@ -89,7 +89,7 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin,
#
# A MailList object's basic Python object model support
#
- def __init__(self, name=None, lock=True):
+ def __init__(self, name=None, lock=True, check_version=True):
# No timeout by default. If you want to timeout, open the list
# unlocked, then lock explicitly.
#
@@ -130,7 +130,7 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin,
# This will load the database.
self.Lock()
else:
- self.Load(name)
+ self.Load(name, check_version)
def __getattr__(self, name):
# Because we're using delegation, we want to be sure that attribute
diff --git a/Mailman/Utils.py b/Mailman/Utils.py
index 53ece3ecd..10281bdcc 100644
--- a/Mailman/Utils.py
+++ b/Mailman/Utils.py
@@ -43,6 +43,13 @@ from Mailman import Errors
from Mailman.SafeDict import SafeDict
from Mailman.configuration import config
+# REMOVEME when Python 2.4 is minimum requirement
+try:
+ set
+except NameError:
+ from sets import Set as set
+
+
EMPTYSTRING = ''
UEMPTYSTRING = u''
CR = '\r'
diff --git a/Mailman/bin/list_lists.py b/Mailman/bin/list_lists.py
index f4a193f18..b766f85bc 100644
--- a/Mailman/bin/list_lists.py
+++ b/Mailman/bin/list_lists.py
@@ -69,7 +69,7 @@ def main():
parser, opts, args = parseargs()
config.load(opts.config)
- names = Utils.list_names()
+ names = list(Utils.list_names())
names.sort()
mlists = []
longest = 0
diff --git a/Mailman/bin/update.py b/Mailman/bin/update.py
index 36812dcf8..1577f0450 100644
--- a/Mailman/bin/update.py
+++ b/Mailman/bin/update.py
@@ -200,7 +200,7 @@ def situate_list(listname):
# This turns the directory called 'listname' into a directory called
# 'listname@domain'. Start by finding out what the domain should be.
# A list's domain is its email host.
- mlist = MailList.MailList(listname, lock=False)
+ mlist = MailList.MailList(listname, lock=False, check_version=False)
fullname = mlist.fqdn_listname
oldpath = os.path.join(config.VAR_PREFIX, 'lists', listname)
newpath = os.path.join(config.VAR_PREFIX, 'lists', fullname)
@@ -314,7 +314,7 @@ script.
else:
# directory
print _("""\
- looks like you have a really recent CVS installation...
+ looks like you have a really recent development installation...
you're either one brave soul, or you already ran me""")
# Move public archive mbox there if it's around
# and take into account all sorts of absurdities.
@@ -333,7 +333,7 @@ script.
$newname""")
else: # directory
print _("""\
- looks like you have a really recent CVS installation...
+ looks like you have a really recent development installation...
you're either one brave soul, or you already ran me""")
# Move the html archives there
if os.path.isdir(o_html_dir):