diff --git a/mercurial_keyring.py b/mercurial_keyring.py --- a/mercurial_keyring.py +++ b/mercurial_keyring.py @@ -220,7 +220,7 @@ class PasswordStore(object): password = keyring.get_password(KEYRING_SERVICE, pwdkey) except Exception as err: ui = uimod.ui() - ui.warn(_("keyring: keyring backend doesn't seem to work, password can not be restored. Falling back to prompts. Error details: %s\n"), + ui.warn(_("keyring: keyring backend doesn't seem to work, password can not be restored. Falling back to prompts. Error details: %s\n") % err) return '' # Reverse recoding from next routine @@ -240,7 +240,7 @@ class PasswordStore(object): KEYRING_SERVICE, pwdkey, password) except Exception as err: ui = uimod.ui() - ui.warn(_("keyring: keyring backend doesn't seem to work, password was not saved. Error details: %s\n"), + ui.warn(_("keyring: keyring backend doesn't seem to work, password was not saved. Error details: %s\n") % err) @@ -329,8 +329,8 @@ class HTTPPasswordHandler(object): parsed_url, url_user, url_passwd = self.unpack_url(authuri) base_url = str(parsed_url) - ui.debug(_('keyring: base url: %s, url user: %s, url pwd: %s\n'), - base_url, url_user or '', url_passwd and '******' or '') + ui.debug(_('keyring: base url: %s, url user: %s, url pwd: %s\n') % + (base_url, url_user or '', url_passwd and '******' or '')) # Extract username (or password) stored directly in url if url_user and url_passwd: @@ -371,8 +371,8 @@ class HTTPPasswordHandler(object): # Load from keyring. if actual_user: - ui.debug(_("keyring: looking for password (user %s, url %s)\n"), - actual_user, keyring_url) + ui.debug(_("keyring: looking for password (user %s, url %s)\n") % + (actual_user, keyring_url)) keyring_pwd = password_store.get_http_password(keyring_url, actual_user) if keyring_pwd: return actual_user, keyring_pwd, self.SRC_KEYRING, keyring_url @@ -389,8 +389,8 @@ class HTTPPasswordHandler(object): ui.status(_("keyring: username not specified in hgrc (or in url). Password will not be saved.\n")) ui.write(_("http authorization required\n")) - ui.status(_("realm: %s\n"), realm) - ui.status(_("url: %s\n"), url) + ui.status(_("realm: %s\n") % realm) + ui.status(_("url: %s\n") % url) if user: ui.write(_("user: %s (fixed in hgrc or url)\n", user)) else: @@ -625,13 +625,13 @@ def try_smtp_login(ui, smtp_obj, usernam if not password: return False try: - ui.note(_('(authenticating to mail server as %s)\n'), + ui.note(_('(authenticating to mail server as %s)\n') % username) smtp_obj.login(username, password) return True except smtplib.SMTPException as inst: if inst.smtp_code == 535: - ui.status(_("SMTP login failed: %s\n\n"), + ui.status(_("SMTP login failed: %s\n\n") % inst.smtp_error) return False else: @@ -694,8 +694,8 @@ def keyring_supported_smtp(ui, username) else: defaultport = 25 mailport = util.getport(ui.config('smtp', 'port', defaultport)) - ui.note(_('sending mail: smtp host %s, port %s\n'), - mailhost, mailport) + ui.note(_('sending mail: smtp host %s, port %s\n') % + (mailhost, mailport)) s.connect(host=mailhost, port=mailport) if starttls: ui.note(_('(using starttls)\n')) @@ -797,20 +797,20 @@ def cmd_keyring_check(ui, repo, *path_ar for name, url in paths: if not is_http_path(url): if path_args: - ui.status(_(" %s: non-http path (%s)\n"), - name, url) + ui.status(_(" %s: non-http path (%s)\n") % + (name, url)) continue user, pwd, source, final_url = handler.get_credentials( make_passwordmgr(ui), name, url) if pwd: - ui.status(_(" %s: password available, source: %s, bound to user %s, url %s\n"), - name, source, user, final_url) + ui.status(_(" %s: password available, source: %s, bound to user %s, url %s\n") % + (name, source, user, final_url)) elif user: - ui.status(_(" %s: password not available, once entered, will be bound to user %s, url %s\n"), - name, user, final_url) + ui.status(_(" %s: password not available, once entered, will be bound to user %s, url %s\n") % + (name, user, final_url)) else: - ui.status(_(" %s: password not available, user unknown, url %s\n"), - name, final_url) + ui.status(_(" %s: password not available, user unknown, url %s\n") % + (name, final_url)) @command(b'keyring_clear', @@ -830,8 +830,8 @@ def cmd_keyring_clear(ui, repo, path, ** path_url = url break if not is_http_path(path_url): - ui.status(_("%s is not a http path (and %s can't be resolved as path alias)\n"), - path, path_url) + ui.status(_("%s is not a http path (and %s can't be resolved as path alias)\n") % + (path, path_url)) return handler = HTTPPasswordHandler() @@ -839,21 +839,21 @@ def cmd_keyring_clear(ui, repo, path, ** user, pwd, source, final_url = handler.get_credentials( make_passwordmgr(ui), path, path_url) if not user: - ui.status(_("Username not configured for url %s\n"), + ui.status(_("Username not configured for url %s\n") % final_url) return if not pwd: - ui.status(_("No password is saved for user %s, url %s\n"), - user, final_url) + ui.status(_("No password is saved for user %s, url %s\n") % + (user, final_url)) return if source != handler.SRC_KEYRING: - ui.status(_("Password for user %s, url %s is saved in %s, not in keyring\n"), - user, final_url, source) + ui.status(_("Password for user %s, url %s is saved in %s, not in keyring\n") % + (user, final_url, source)) password_store.clear_http_password(final_url, user) - ui.status(_("Password removed for user %s, url %s\n"), - user, final_url) + ui.status(_("Password removed for user %s, url %s\n") % + (user, final_url)) buglink = 'https://bitbucket.org/Mekk/mercurial_keyring/issues'