本文整理汇总了Python中gi.repository.Secret.password_clear_sync方法的典型用法代码示例。如果您正苦于以下问题:Python Secret.password_clear_sync方法的具体用法?Python Secret.password_clear_sync怎么用?Python Secret.password_clear_sync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gi.repository.Secret
的用法示例。
在下文中一共展示了Secret.password_clear_sync方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_account_password
# 需要导入模块: from gi.repository import Secret [as 别名]
# 或者: from gi.repository.Secret import password_clear_sync [as 别名]
def set_account_password(email, password):
attrs = {"email": email}
if password:
Secret.password_store_sync(_ACCOUNT_SCHEMA, attrs, Secret.COLLECTION_DEFAULT,
"Pandora Account", password, None)
else:
Secret.password_clear_sync(_ACCOUNT_SCHEMA, attrs, None)
示例2: erase
# 需要导入模块: from gi.repository import Secret [as 别名]
# 或者: from gi.repository.Secret import password_clear_sync [as 别名]
def erase():
attributes = get_attributes()
if 'password' in attributes:
del attributes['password']
Secret.password_clear_sync(
GIT_CREDENTIALS_SCHEMA,
attributes,
None
)
示例3: testSyncNotFound
# 需要导入模块: from gi.repository import Secret [as 别名]
# 或者: from gi.repository.Secret import password_clear_sync [as 别名]
def testSyncNotFound(self):
attributes = { "number": "11", "string": "one", "even": "true" }
password = Secret.password_lookup_sync(STORE_SCHEMA, attributes, None)
self.assertEqual(None, password)
deleted = Secret.password_clear_sync(STORE_SCHEMA, attributes, None)
self.assertEqual(False, deleted)
示例4: testSynchronous
# 需要导入模块: from gi.repository import Secret [as 别名]
# 或者: from gi.repository.Secret import password_clear_sync [as 别名]
def testSynchronous(self):
attributes = { "number": "1", "string": "one", "even": "false" }
password = Secret.password_lookup_sync(STORE_SCHEMA, attributes, None)
self.assertEqual("111", password)
deleted = Secret.password_clear_sync(STORE_SCHEMA, attributes, None)
self.assertEqual(True, deleted)
示例5: clear
# 需要导入模块: from gi.repository import Secret [as 别名]
# 或者: from gi.repository.Secret import password_clear_sync [as 别名]
def clear():
"""
Clear all existing accounts.
:return bool: Either the token was removed successfully or not
"""
schema = Keyring.get_default().schema
success = Secret.password_clear_sync(schema, {}, None)
return success
示例6: remove
# 需要导入模块: from gi.repository import Secret [as 别名]
# 或者: from gi.repository.Secret import password_clear_sync [as 别名]
def remove(secret_id):
"""
Remove a specific secret OTP token.
:param secret_id: the secret ID associated to the OTP token
:return bool: Either the token was removed successfully or not
"""
schema = Keyring.get_default().schema
success = Secret.password_clear_sync(
schema, {"id": str(secret_id)}, None)
return success
示例7: clear_password
# 需要导入模块: from gi.repository import Secret [as 别名]
# 或者: from gi.repository.Secret import password_clear_sync [as 别名]
def clear_password(self, scheme, host, username):
"""Remove the password from the cache."""
template = dict(zip(self.category, (scheme, host, username)))
Secret.password_clear_sync(self.schema, template, None)
示例8: do_delete
# 需要导入模块: from gi.repository import Secret [as 别名]
# 或者: from gi.repository.Secret import password_clear_sync [as 别名]
def do_delete(self, id):
Secret.password_clear_sync(SCHEMA, {'id': id}, None)
示例9: _clear_account_password
# 需要导入模块: from gi.repository import Secret [as 别名]
# 或者: from gi.repository.Secret import password_clear_sync [as 别名]
def _clear_account_password(email):
return Secret.password_clear_sync(_ACCOUNT_SCHEMA, {"email": email}, None)