本文整理汇总了Python中gi.repository.Secret.password_lookup_finish方法的典型用法代码示例。如果您正苦于以下问题:Python Secret.password_lookup_finish方法的具体用法?Python Secret.password_lookup_finish怎么用?Python Secret.password_lookup_finish使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gi.repository.Secret
的用法示例。
在下文中一共展示了Secret.password_lookup_finish方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_password_lookup_finish
# 需要导入模块: from gi.repository import Secret [as 别名]
# 或者: from gi.repository.Secret import password_lookup_finish [as 别名]
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)
示例2: _on_password_lookup
# 需要导入模块: from gi.repository import Secret [as 别名]
# 或者: from gi.repository.Secret import password_lookup_finish [as 别名]
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)
示例3: _on_password_lookup
# 需要导入模块: from gi.repository import Secret [as 别名]
# 或者: from gi.repository.Secret import password_lookup_finish [as 别名]
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)
示例4: __on_password_lookup
# 需要导入模块: from gi.repository import Secret [as 别名]
# 或者: from gi.repository.Secret import password_lookup_finish [as 别名]
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)
示例5: on_result_ready
# 需要导入模块: from gi.repository import Secret [as 别名]
# 或者: from gi.repository.Secret import password_lookup_finish [as 别名]
def on_result_ready(source, result, unused):
loop.quit()
password = Secret.password_lookup_finish(result)
self.assertEquals(None, password)
示例6: _on_password_lookup
# 需要导入模块: from gi.repository import Secret [as 别名]
# 或者: from gi.repository.Secret import password_lookup_finish [as 别名]
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)