diff options
| author | msapiro | 2006-10-24 03:55:24 +0000 |
|---|---|---|
| committer | msapiro | 2006-10-24 03:55:24 +0000 |
| commit | 3256c431e7bf966d3de49e4dc31dd01d57ffb02f (patch) | |
| tree | e0f32257c2bc73eec34e4ebf2f50c27b0ff23a66 /Mailman/bin/change_pw.py | |
| parent | f0a263b63991efc787bfd870bd7a491c53dce54a (diff) | |
| download | mailman-3256c431e7bf966d3de49e4dc31dd01d57ffb02f.tar.gz mailman-3256c431e7bf966d3de49e4dc31dd01d57ffb02f.tar.zst mailman-3256c431e7bf966d3de49e4dc31dd01d57ffb02f.zip | |
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.
Diffstat (limited to 'Mailman/bin/change_pw.py')
| -rw-r--r-- | Mailman/bin/change_pw.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Mailman/bin/change_pw.py b/Mailman/bin/change_pw.py index d77dd9787..fa0289907 100644 --- a/Mailman/bin/change_pw.py +++ b/Mailman/bin/change_pw.py @@ -23,8 +23,9 @@ from Mailman import Errors 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 @@ SPACE = ' ' def parseargs(): - parser = optparse.OptionParser(version=mm_cfg.MAILMAN_VERSION, + parser = optparse.OptionParser(version=Version.MAILMAN_VERSION, usage=_("""\ %%prog [options] @@ -75,6 +76,8 @@ not given, lists will be assigned a randomly generated new password.""")) 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 openlist(listname): def main(): parser, opts, args = parseargs() + config.load(opts.config) # Cull duplicates domains = set(opts.domains) @@ -135,7 +139,7 @@ def main(): 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: |
