237 |
237 |
238 def __strReverse(self, string): |
238 def __strReverse(self, string): |
239 """ |
239 """ |
240 Private method to reverse a string. |
240 Private method to reverse a string. |
241 |
241 |
242 @param string string to be reversed (string) |
242 @param string string to be reversed |
243 @return reversed string (string) |
243 @type str |
|
244 @return reversed string |
|
245 @rtype str |
244 """ |
246 """ |
245 return "".join(reversed(string)) |
247 return "".join(reversed(string)) |
246 |
248 |
247 def __determineStatus(self, value): |
249 def __determineStatus(self, value): |
248 """ |
250 """ |
249 Private method to determine the status. |
251 Private method to determine the status. |
250 |
252 |
251 @param value value to check (integer) |
253 @param value value to check |
|
254 @type int |
252 @return status (Status_Failed, Status_Passed, Status_Exceeded) |
255 @return status (Status_Failed, Status_Passed, Status_Exceeded) |
|
256 @rtype int |
253 """ |
257 """ |
254 if value == 0: |
258 if value == 0: |
255 return self.Status_Passed |
259 return self.Status_Passed |
256 elif value > 0: |
260 elif value > 0: |
257 return self.Status_Exceeded |
261 return self.Status_Exceeded |
260 |
264 |
261 def __determineBinaryStatus(self, value): |
265 def __determineBinaryStatus(self, value): |
262 """ |
266 """ |
263 Private method to determine a binary status. |
267 Private method to determine a binary status. |
264 |
268 |
265 @param value value to check (integer) |
269 @param value value to check |
|
270 @type int |
266 @return status (Status_Failed, Status_Passed) |
271 @return status (Status_Failed, Status_Passed) |
|
272 @rtype int |
267 """ |
273 """ |
268 if value == 0: |
274 if value == 0: |
269 return self.Status_Passed |
275 return self.Status_Passed |
270 else: |
276 else: |
271 return self.Status_Failed |
277 return self.Status_Failed |
272 |
278 |
273 def checkPassword(self, password): |
279 def checkPassword(self, password): |
274 """ |
280 """ |
275 Public method to check a given password. |
281 Public method to check a given password. |
276 |
282 |
277 @param password password to be checked (string) |
283 @param password password to be checked |
|
284 @type str |
278 @return indication for the password strength (Complexity_VeryWeak, |
285 @return indication for the password strength (Complexity_VeryWeak, |
279 Complexity_Weak, Complexity_Good, Complexity_Strong, |
286 Complexity_Weak, Complexity_Good, Complexity_Strong, |
280 Complexity_VeryStrong) |
287 Complexity_VeryStrong) |
|
288 @rtype int |
281 """ |
289 """ |
282 # how long is the password? |
290 # how long is the password? |
283 self.passwordLength["count"] = len(password) |
291 self.passwordLength["count"] = len(password) |
284 self.recommendedPasswordLength["count"] = len(password) |
292 self.recommendedPasswordLength["count"] = len(password) |
285 |
293 |