예제 #1
0
 def password_callback(source, result):
     password = Secret.password_lookup_finish(result)
     if password:
         log.debug("Found the SMTP password in the keyring.")
     else:
         log.debug("Did not find the SMTP password in the keyring.")
     callback(password or '')
예제 #2
0
파일: util.py 프로젝트: Wisperer/PithosFly
 def on_password_lookup_finish(source, result, data):
     try:
         password = Secret.password_lookup_finish(result) or ''
     except GLib.Error as e:
         password = ''
         logging.error('Failed to lookup password, Error: {}'.format(e))
     callback(password)
예제 #3
0
 def on_password_lookup_finish(source, result, data):
     try:
         password = Secret.password_lookup_finish(result) or ''
     except GLib.Error as e:
         future.set_exception(e)
     else:
         future.set_result(password)
예제 #4
0
파일: util.py 프로젝트: JasonLG1979/pithos
 def on_password_lookup_finish(source, result, data):
     try:
         password = Secret.password_lookup_finish(result) or ''
     except GLib.Error as e:
         password = ''
         logging.error('Failed to lookup password, Error: {}'.format(e))
     callback(password)
예제 #5
0
 def loaded(source, result, data):
     password = Secret.password_lookup_finish(result)
     if password is None:
         # We fallback to session storage
         return super(SecretKeyring, self).load_credentials()
     else:
         self.password = password
         GLib.idle_add(self.emit, 'password-loaded')
예제 #6
0
 def _on_password_lookup(self, source, result):
     """
         Set password entry
         @param source as GObject.Object
         @param result Gio.AsyncResult
     """
     password = None
     if result is not None:
         password = Secret.password_lookup_finish(result)
     if password is not None:
         self._password.set_text(password)
예제 #7
0
파일: lastfm.py 프로젝트: ktosiu/lollypop
 def _on_password_lookup(self, source, result):
     """
         Init self object
         @param source as GObject.Object
         @param result Gio.AsyncResult
     """
     try:
         password = Secret.password_lookup_finish(result)
         self._password = password
         if Gio.NetworkMonitor.get_default().get_network_available():
             start_new_thread(self._connect, (self._username, password))
     except Exception as e:
         print("Lastfm::_on_password_lookup(): %s" % e)
예제 #8
0
파일: lastfm.py 프로젝트: ktosiu/lollypop
 def _on_password_lookup(self, source, result):
     """
         Init self object
         @param source as GObject.Object
         @param result Gio.AsyncResult
     """
     try:
         password = Secret.password_lookup_finish(result)
         self._password = password
         if Gio.NetworkMonitor.get_default().get_network_available():
             start_new_thread(self._connect, (self._username, password))
     except Exception as e:
         print("Lastfm::_on_password_lookup(): %s" % e)
예제 #9
0
 def __on_password_lookup(self, source, result):
     """
         Set password entry
         @param source as GObject.Object
         @param result Gio.AsyncResult
     """
     try:
         password = None
         if result is not None:
             password = Secret.password_lookup_finish(result)
         if password is not None:
             self.__password.set_text(password)
     except:
         pass
예제 #10
0
 def __on_password_lookup(self, source, result):
     """
         Init self object
         @param source as GObject.Object
         @param result Gio.AsyncResult
     """
     try:
         password = Secret.password_lookup_finish(result)
         self.__password = password
         if get_network_available():
             t = Thread(target=self.__connect,
                        args=(self.__username, password))
             t.daemon = True
             t.start()
     except Exception as e:
         print("Lastfm::__on_password_lookup(): %s" % e)
예제 #11
0
 def __on_password_lookup(self, source, result):
     """
         Init self object
         @param source as GObject.Object
         @param result Gio.AsyncResult
     """
     try:
         password = Secret.password_lookup_finish(result)
         self.__password = password
         if get_network_available():
             t = Thread(target=self.__connect,
                        args=(self.__username, password))
             t.daemon = True
             t.start()
     except Exception as e:
         print("Lastfm::__on_password_lookup(): %s" % e)
예제 #12
0
 def on_result_ready(source, result, unused):
     loop.quit()
     password = Secret.password_lookup_finish(result)
     self.assertEquals(None, password)
예제 #13
0
		def on_result_ready(source, result, unused):
			loop.quit()
			password = Secret.password_lookup_finish(result)
			self.assertEquals(None, password)
예제 #14
0
 def _on_password_lookup(self, source, result):
     password = None
     if result is not None:
         password = Secret.password_lookup_finish(result)
     if password is not None:
         self._password.set_text(password)
예제 #15
0
 def _finishLookup(self, source, result, callback):
     secret = Secret.password_lookup_finish(result)
     if secret: callback(*json.loads(secret))
예제 #16
0
 def secret_callback(source_object, result, user_data):
     print("looked up in secret")
     self._token_cache = Secret.password_lookup_finish(result)
     print("lookup finish")
     callback(self._token_cache, user_data)