Jan Dittberner
a7edeca826
- better code structure - class for domain - class for preferences - password generation function git-svn-id: file:///home/www/usr01/svn/gnuviechadmin/gnuviech.info/gnuviechadmin/trunk@82 a67ec6bc-e5d5-0310-a910-815c51eb3124
20 lines
585 B
Python
20 lines
585 B
Python
import gnuviech
|
|
import gnuviech.tools
|
|
|
|
if __name__ == "__main__":
|
|
print gnuviech.GNVPrefs()
|
|
minlen = 0
|
|
avglen = 0
|
|
maxlen = 0
|
|
pwds = 20
|
|
for i in range(pwds):
|
|
pwd = gnuviech.tools.generatePassword()
|
|
print "%02d: %s (%d)" % (i, pwd, len(pwd))
|
|
if (minlen == 0) or (len(pwd) < minlen): minlen = len(pwd)
|
|
if (len(pwd) > maxlen): maxlen = len(pwd)
|
|
avglen += len(pwd)
|
|
avglen = avglen/pwds
|
|
print """average password length: %d
|
|
minimum password length: %d
|
|
maximum password length: %d""" % (avglen, minlen, maxlen)
|
|
|