From cbef3114de3e80b9436d909b11568858e3a1cf42 Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Sat, 8 Jul 2006 17:37:55 +0000 Subject: Massive conversion process so that Mailman can be run from a user specified configuration file. While the full conversion is not yet complete, everything that seems to be required to run mailmanctl, qrunner, rmlist, and newlist have been updated. Basically, modules should no longer import mm_cfg, but instead they should import Mailman.configuration.config. The latter is an object that's guaranteed to exist, but not guaranteed to be initialized until some top-level script calls config.load(). The latter should be called with the argument to -C/--config which is a new convention the above scripts have been given. In most cases, where mm_cfg. is used config. can be used, but the exceptions are where the default value must be available before config.load() is called. Sometimes you can import Mailman.Default and get the variable from there, but other times the code has to be changed to work around this limitation. Take each on a case-by-case basis. Note that the various directories calculated from VAR_PREFIX, EXEC_PREFIX, and PREFIX are now calculated in config.py, not in Defaults.py. This way a configuration file can override the base directories and everything should work correctly. Other changes here include: - mailmanctl, qrunner, and update are switched to optparse and $-strings, and changed to the mmshell architecture - An etc directory has been added to /usr/local/mailman and a mailman.cfg.sample file is installed there. Sites should now edit an etc/mailman.cfg file to do their configurations, although the mm_cfg file is still honored. The formats of the two files are identical. - list_lists is given the -C/--config option - Some coding style fixes in bin/update, but not extensive - Get rid of nested scope hacks in qrunner.py - A start on getting EmailBase tests working (specifically test_message), although not yet complete. --- Mailman/Queue/Switchboard.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Mailman/Queue/Switchboard.py') diff --git a/Mailman/Queue/Switchboard.py b/Mailman/Queue/Switchboard.py index 36b69283e..d9fc5dc27 100644 --- a/Mailman/Queue/Switchboard.py +++ b/Mailman/Queue/Switchboard.py @@ -12,7 +12,8 @@ # # 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. """Reading and writing message objects and message metadata.""" @@ -41,8 +42,8 @@ import cPickle import marshal from Mailman import Message -from Mailman import mm_cfg from Mailman import Utils +from Mailman.configuration import config # 20 bytes of all bits set, maximum sha.digest() value shamax = 0xffffffffffffffffffffffffffffffffffffffffL @@ -104,7 +105,7 @@ class Switchboard: filename = os.path.join(self.__whichq, filebase + '.pck') tmpfile = filename + '.tmp' # Always add the metadata schema version number - data['version'] = mm_cfg.QFILE_SCHEMA_VERSION + data['version'] = config.QFILE_SCHEMA_VERSION # Filter out volatile entries for k in data.keys(): if k.startswith('_'): -- cgit v1.2.3-70-g09d2