server/utils.py
branchstable
changeset 3701 104b7c326172
parent 3585 cd437d24aa65
child 4212 ab6573088b4a
equal deleted inserted replaced
3700:fd550e4dc515 3701:104b7c326172
    69 (the server doesn\'t have to run, even should better not)'
    69 (the server doesn\'t have to run, even should better not)'
    70 
    70 
    71 def manager_userpasswd(user=None, msg=DEFAULT_MSG, confirm=False,
    71 def manager_userpasswd(user=None, msg=DEFAULT_MSG, confirm=False,
    72                        passwdmsg='password'):
    72                        passwdmsg='password'):
    73     if not user:
    73     if not user:
    74         print msg
    74         if msg:
       
    75             print msg
    75         while not user:
    76         while not user:
    76             user = raw_input('login: ')
    77             user = raw_input('login: ')
    77         user = unicode(user, sys.stdin.encoding)
    78         user = unicode(user, sys.stdin.encoding)
    78     passwd = getpass('%s: ' % passwdmsg)
    79     passwd = getpass('%s: ' % passwdmsg)
    79     if confirm:
    80     if confirm: