def _updatePasswordStrengthLevel(self):
     password = None
     if self.showPasswordButton.state() == NSOnState:
         password = self.clearPasswordField.stringValue()
     else:
         password = self.bulletPasswordField.stringValue()
     username = self.userField.stringValue() != '' and self.userField.stringValue() or None
     score = calculate_password_strength(password, username)
     self.passwordStrengthIndicator.setIntValue_(score)
 def _updatePasswordStrengthLevel(self):
     password = self.passwordField.stringValue()
     score = calculate_password_strength(password)
     self.passwordStrengthIndicator.setIntValue_(score)