Commit 90b46b59 authored by Guido van Rossum's avatar Guido van Rossum

Improve the interactive loop to get the encoding; stop only when a

valid value is input, or the empty string, and interpret the empty
string as the default.  Indicate the default in the prompt.
parent a8226c4e
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
############################################################################## ##############################################################################
"""Zope user bootstrap system""" """Zope user bootstrap system"""
__version__='$Revision: 1.15 $ '[11:-2] __version__='$Revision: 1.16 $ '[11:-2]
import sys, sha, binascii, random, getopt, getpass, os import sys, sha, binascii, random, getopt, getpass, os
...@@ -173,12 +173,15 @@ Copyright (C) 1999, 2000 Digital Creations, Inc. ...@@ -173,12 +173,15 @@ Copyright (C) 1999, 2000 Digital Creations, Inc.
print """ print """
Please choose a format from: Please choose a format from:
SHA - SHA-1 hashed password SHA - SHA-1 hashed password (default)
CRYPT - UNIX-style crypt password CRYPT - UNIX-style crypt password
CLEARTEXT - no protection. CLEARTEXT - no protection
""" """
encoding = raw_input("Encoding: ") encoding = raw_input("Encoding: ")
if encoding != '': if encoding == '':
encoding = 'SHA'
break
if encoding.upper() in ['SHA', 'CRYPT', 'CLEARTEXT']:
break break
domains = raw_input("Domain restrictions: ") domains = raw_input("Domain restrictions: ")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment