Commit 45270140 authored by Jordi Mallach's avatar Jordi Mallach 🔥

Merge branch 'eze/add-useful-user-messages' into 'master'

Add some useful print messages

See merge request collabora/gtimelog!2
parents c8898bdc cb226744
......@@ -775,6 +775,7 @@ class Authenticator(object):
gi.require_version('GnomeKeyring', '1.0')
from gi.repository import GnomeKeyring as gnomekeyring
except ImportError:
print("GnomeKeyring not found. You will not be able to use the password keyring.")
gnomekeyring = None
def __init__(self):
......@@ -819,7 +820,7 @@ class Authenticator(object):
callback(username, password)
def save_to_keyring(self, uri, username, password):
self.gnomekeyring.set_network_password_sync (
result, keys = self.gnomekeyring.set_network_password_sync (
None, # keyring
username, # user
uri.get_host(), # domain
......@@ -829,6 +830,10 @@ class Authenticator(object):
None, # authtype
uri.get_port(), # port
password) # password
if result == self.gnomekeyring.Result.OK:
print("Password saved successfully")
print("Failed to save password, error={}", result)
def ask_the_user(self, auth, uri, callback):
"""Pops up a username/password dialog for uri"""
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment