view MoinMoin/script/account/ @ 670:687633456631

MoinMoin.script: move _util stuff to __init__
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 20 May 2006 23:40:21 +0200
parents 069acf15d7b3
children 6dd2e29acffe
line wrap: on
line source
# -*- coding: iso-8859-1 -*-
    MoinMoin - create a user account

    @copyright: 2006 by MoinMoin:ThomasWaldmann
    @license: GNU GPL, see COPYING for details.

from MoinMoin.script import MoinScript

class PluginScript(MoinScript):
    def __init__(self, argv, def_values):
        MoinScript.__init__(self, argv, def_values)
            "--name", metavar="NAME", dest="uname",
            help="Set the wiki user name to NAME."
            "--alias", metavar="ALIAS", dest="ualiasname",
            help="Set the wiki user alias name to ALIAS (e.g. the real name if NAME is cryptic)."
            "--email", metavar="EMAIL", dest="email",
            help="Set the user's email address to EMAIL."
            "--password", metavar="PASSWORD", dest="password",
            help="Set the user's password to PASSWORD (either cleartext or {SHA1}...)."

    def mainloop(self):
        # we don't expect non-option arguments
        if len(self.args) != 0:
            self.parser.error("incorrect number of arguments")

        flags_given = self.options.uname and
        if not flags_given:
            import sys

        request = self.request

        from MoinMoin import user, wikiutil
        u = user.User(request, None, self.options.uname, password=self.options.password) =
        u.aliasname = self.options.ualiasname or ''
        print " %-20s %-25s %-35s" % (,,,
        print "- created."