##// END OF EJS Templates
added optional password type in password generator
marcink -
r1993:4d3179d2 beta
parent child Browse files
Show More
@@ -80,7 +80,9 b' class PasswordGenerator(object):'
80 def __init__(self, passwd=''):
80 def __init__(self, passwd=''):
81 self.passwd = passwd
81 self.passwd = passwd
82
82
83 def gen_password(self, length, type_):
83 def gen_password(self, length, type_=None):
84 if type_ is None:
85 type_ = self.ALPHABETS_FULL
84 self.passwd = ''.join([random.choice(type_) for _ in xrange(length)])
86 self.passwd = ''.join([random.choice(type_) for _ in xrange(length)])
85 return self.passwd
87 return self.passwd
86
88
General Comments 0
You need to be logged in to leave comments. Login now