[Zope-Checkins] CVS: Zope - zpasswd.py:1.16

Guido van Rossum guido@python.org
Wed, 22 May 2002 21:01:46 -0400


Update of /cvs-repository/Zope
In directory cvs.zope.org:/tmp/cvs-serv18680

Modified Files:
	zpasswd.py 
Log Message:
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.


=== Zope/zpasswd.py 1.15 => 1.16 ===
 Please choose a format from:
 
-SHA - SHA-1 hashed password
+SHA - SHA-1 hashed password (default)
 CRYPT - UNIX-style crypt password
-CLEARTEXT - no protection.
+CLEARTEXT - no protection
 """
                 encoding = raw_input("Encoding: ")
-                if encoding != '':
+                if encoding == '':
+                    encoding = 'SHA'
+                    break
+                if encoding.upper() in ['SHA', 'CRYPT', 'CLEARTEXT']:
                     break
 
             domains = raw_input("Domain restrictions: ")