Revision: 8091
http://svn.sourceforge.net/mailman/?rev=8091&view=rev
Author: bwarsaw
Date: 2006-11-11 19:14:00 -0800 (Sat, 11 Nov 2006)
Log Message:
-----------
We need to substitute the fully qualified list name in the public archive url.
Do this and switch PUBLIC_ARCHIVE_URL to use $-substitution strings instead of
%-substitution strings (no backward compatibility is provided).
Minor style nits.
Modified Paths:
--------------
trunk/mailman/Mailman/Archiver/Archiver.py
trunk/mailman/Mailman/Cgi/edithtml.py
trunk/mailman/Mailman/Cgi/wsgi_app.py
trunk/mailman/Mailman/Defaults.py.in
trunk/mailman/NEWS.txt
Modified: trunk/mailman/Mailman/Archiver/Archiver.py
===================================================================
--- trunk/mailman/Mailman/Archiver/Archiver.py 2006-11-09 01:13:59 UTC (rev
8090)
+++ trunk/mailman/Mailman/Archiver/Archiver.py 2006-11-12 03:14:00 UTC (rev
8091)
@@ -29,6 +29,7 @@
import traceback
from cStringIO import StringIO
+from string import Template
from Mailman import Mailbox
from Mailman import Utils
@@ -139,10 +140,11 @@
url = self.GetScriptURL('private') + '/index.html'
else:
web_host = config.domains.get(self.host_name, self.host_name)
- url = config.PUBLIC_ARCHIVE_URL % {
- 'listname': self.internal_name(),
- 'hostname': web_host,
- }
+ url = Template(config.PUBLIC_ARCHIVE_URL).safe_substitute(
+ listname=self.internal_name(),
+ hostname=web_host,
+ fqdn_listname=self.fqdn_listname,
+ )
return url
def __archive_file(self, afn):
Modified: trunk/mailman/Mailman/Cgi/edithtml.py
===================================================================
--- trunk/mailman/Mailman/Cgi/edithtml.py 2006-11-09 01:13:59 UTC (rev
8090)
+++ trunk/mailman/Mailman/Cgi/edithtml.py 2006-11-12 03:14:00 UTC (rev
8091)
@@ -23,15 +23,15 @@
import errno
import logging
+from Mailman import Defaults
from Mailman import Errors
-from Mailman import i18n
from Mailman import MailList
from Mailman import Utils
-from Mailman import Defaults
+from Mailman import i18n
from Mailman.Cgi import Auth
-from Mailman.htmlformat import *
from Mailman.HTMLFormatter import HTMLFormatter
from Mailman.configuration import config
+from Mailman.htmlformat import *
_ = i18n._
Modified: trunk/mailman/Mailman/Cgi/wsgi_app.py
===================================================================
--- trunk/mailman/Mailman/Cgi/wsgi_app.py 2006-11-09 01:13:59 UTC (rev
8090)
+++ trunk/mailman/Mailman/Cgi/wsgi_app.py 2006-11-12 03:14:00 UTC (rev
8091)
@@ -19,16 +19,16 @@
import re
import sys
-from urlparse import urlparse
from cStringIO import StringIO
from email import message_from_string
+from urlparse import urlparse
from Mailman.configuration import config
# XXX Should this be configurable in Defaults.py?
STEALTH_MODE = False
MOVED_RESPONSE = '302 Found'
-# Above is for debugging convenience. We should use:
+# Above is for debugging convenience. We should use:
# MOVED_RESPONSE = '301 Moved Permanently'
@@ -50,6 +50,7 @@
SCRIPT_BASE = urlparse(config.DEFAULT_URL_PATTERN)[2]
+
# WSGI to CGI wrapper. Mostly copied from scripts/driver.
def mailman_app(environ, start_response):
Modified: trunk/mailman/Mailman/Defaults.py.in
===================================================================
--- trunk/mailman/Mailman/Defaults.py.in 2006-11-09 01:13:59 UTC (rev
8090)
+++ trunk/mailman/Mailman/Defaults.py.in 2006-11-12 03:14:00 UTC (rev
8091)
@@ -200,11 +200,11 @@
# places, including the List-Archive: header, links to the archive on the
# list's listinfo page, and on the list's admin page.
#
-# This should be a string with "%(listname)s" somewhere in it. Mailman will
-# interpolate the name of the list into this. You can also include a
-# "%(hostname)s" in the string, into which Mailman will interpolate
-# the host name (usually DEFAULT_URL_HOST).
-PUBLIC_ARCHIVE_URL = 'http://%(hostname)s/pipermail/%(listname)s'
+# This variable supports several substitution variables
+# - $hostname -- the host on which the archive resides
+# - $listname -- the short name of the list being accessed
+# - $fqdn_listname -- the long name of the list being accessed
+PUBLIC_ARCHIVE_URL = 'http://$hostname/pipermail/$fqdn_listname'
# Are archives on or off by default?
DEFAULT_ARCHIVE = On
Modified: trunk/mailman/NEWS.txt
===================================================================
--- trunk/mailman/NEWS.txt 2006-11-09 01:13:59 UTC (rev 8090)
+++ trunk/mailman/NEWS.txt 2006-11-12 03:14:00 UTC (rev 8091)
@@ -6,6 +6,24 @@
2.2 alpha 1 (XX-XXX-200X)
+ Configuration
+
+ - Mailman can now be configured via a 'mailman.cfg' file which lives in
+ $VAR_PREFIX/etc. This can be used to separate the configuration from
+ the source directory. Alternative configuration files can be specified
+ via -C/--config for most command line scripts. The format of
+ mailman.cfg is identical to that for mm_cfg.py; IOW, they are both
+ Python files. mm_cfg.py is still supported for backward compatibility,
+ but settings in etc/mailman.cfg take precedence. You do not need to
+ import Defaults.py in etc/mailman.cfg. You should still consult
+ Defaults.py for the list of site configuration variables available to
+ you.
+
+ See the etc/mailman.cfg.sample file.
+
+ - PUBLIC_ARCHIVE_URL now takes $-string substitutions instead of %-string
+ substitutions. See documentation in Defaults.py.in for details.
+
Architecture
- Mailman's web interface is now WSGI compliant. WSGI is a Python
@@ -44,19 +62,6 @@
- If you had customizations based on Site.py, you will need to
re-implement them. Site.py has been removed.
- - Mailman can now be configured via a 'mailman.cfg' file which lives in
- $VAR_PREFIX/etc. This can be used to separate the configuration from
- the source directory. Alternative configuration files can be specified
- via -C/--config for most command line scripts. The format of
- mailman.cfg is identical to that for mm_cfg.py; IOW, they are both
- Python files. mm_cfg.py is still supported for backward compatibility,
- but settings in etc/mailman.cfg take precedence. You do not need to
- import Defaults.py in etc/mailman.cfg. You should still consult
- Defaults.py for the list of site configuration variables available to
- you.
-
- See the etc/mailman.cfg.sample file.
-
- The site list is no more. You can remove your 'mailman' site list
unless you want to retain it for other purposes, but it is no longer
used (or required) by Mailman. You should set NO_REPLY_ADDRESS to an
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