当前位置: 首页>>代码示例>>Python>>正文


Python Secret.password_lookup_sync方法代码示例

本文整理汇总了Python中gi.repository.Secret.password_lookup_sync方法的典型用法代码示例。如果您正苦于以下问题:Python Secret.password_lookup_sync方法的具体用法?Python Secret.password_lookup_sync怎么用?Python Secret.password_lookup_sync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gi.repository.Secret的用法示例。


在下文中一共展示了Secret.password_lookup_sync方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testSynchronous

# 需要导入模块: from gi.repository import Secret [as 别名]
# 或者: from gi.repository.Secret import password_lookup_sync [as 别名]
	def testSynchronous(self):
		attributes = { "number": "9", "string": "nine", "even": "false" }

		password = Secret.password_lookup_sync(STORE_SCHEMA, attributes, None)
		self.assertEqual(None, password)

		stored = Secret.password_store_sync(STORE_SCHEMA, attributes, Secret.COLLECTION_DEFAULT,
		                                    "The number nine", "999", None)
		self.assertEqual(True, stored);

		password = Secret.password_lookup_sync(STORE_SCHEMA, attributes, None)
		self.assertEqual("999", password)
开发者ID:Pusenka,项目名称:libsecret,代码行数:14,代码来源:test-store-password.py

示例2: testSyncNotFound

# 需要导入模块: from gi.repository import Secret [as 别名]
# 或者: from gi.repository.Secret import password_lookup_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_remove_sync(STORE_SCHEMA, attributes, None)
		self.assertEqual(False, deleted)
开发者ID:Pusenka,项目名称:libsecret,代码行数:10,代码来源:test-remove-password.py

示例3: testSynchronous

# 需要导入模块: from gi.repository import Secret [as 别名]
# 或者: from gi.repository.Secret import password_lookup_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_remove_sync(STORE_SCHEMA, attributes, None)
		self.assertEqual(True, deleted)
开发者ID:Pusenka,项目名称:libsecret,代码行数:10,代码来源:test-remove-password.py

示例4: find_password

# 需要导入模块: from gi.repository import Secret [as 别名]
# 或者: from gi.repository.Secret import password_lookup_sync [as 别名]
 def find_password(self, scheme, host, username):
     """Return the password of [email protected]"""
     template = dict(zip(self.category, (scheme, host, username)))
     try:
         password = Secret.password_lookup_sync(self.schema, template, None)
     except Secret.SECRET_ERROR_PROTOCOL:
         return
     return password
开发者ID:benfitzpatrick,项目名称:rose,代码行数:10,代码来源:ws_client_auth.py

示例5: testAsynchronous

# 需要导入模块: from gi.repository import Secret [as 别名]
# 或者: from gi.repository.Secret import password_lookup_sync [as 别名]
	def testAsynchronous(self):
		attributes = { "number": "888", "string": "eight", "even": "true" }

		password = Secret.password_lookup_sync(STORE_SCHEMA, attributes, None)
		self.assertEqual(None, password);

		loop = GLib.MainLoop(None, False)

		def on_result_ready(source, result, unused):
			loop.quit()
			stored = Secret.password_store_finish(result)
			self.assertEquals(True, stored)

		Secret.password_store(STORE_SCHEMA, attributes, None, "The number eight", "888",
		                      None, on_result_ready, None)

		loop.run()

		password = Secret.password_lookup_sync(STORE_SCHEMA, attributes, None)
		self.assertEqual("888", password)
开发者ID:Pusenka,项目名称:libsecret,代码行数:22,代码来源:test-store-password.py

示例6: get_by_id

# 需要导入模块: from gi.repository import Secret [as 别名]
# 或者: from gi.repository.Secret import password_lookup_sync [as 别名]
    def get_by_id(secret_id):
        """
        Return the OTP token based on a secret ID.

        :param secret_id: the secret ID associated to an OTP token
        :type secret_id: str
        :return: the secret OTP token.
        """
        schema = Keyring.get_default().schema
        password = Secret.password_lookup_sync(
            schema, {"id": str(secret_id)}, None)
        return password
开发者ID:bil-elmoussaoui,项目名称:Gnome-TwoFactorAuth,代码行数:14,代码来源:keyring.py

示例7: getTokens

# 需要导入模块: from gi.repository import Secret [as 别名]
# 或者: from gi.repository.Secret import password_lookup_sync [as 别名]
    def getTokens(self, user):
        attributes = {
                         "user": user,
                         "scope": self.scope,
                     }

        password = Secret.password_lookup_sync(self.TOKEN_SCHEMA,
                                               attributes, None)

        if password:
            return self.decodeTokens(password)
        else:
            return (None, None)
开发者ID:scop,项目名称:gnome-gmail,代码行数:15,代码来源:gnomegmail.py

示例8: get

# 需要导入模块: from gi.repository import Secret [as 别名]
# 或者: from gi.repository.Secret import password_lookup_sync [as 别名]
def get():
    attributes = get_attributes()

    if 'password' in attributes:
        del attributes['password']
    password = Secret.password_lookup_sync(
        GIT_CREDENTIALS_SCHEMA,
        attributes,
        None
        )
    if password:
        secret_item = find_secret_item(attributes)
        print('protocol=%s' % secret_item['protocol'])
        print('host=%s' % secret_item['host'])
        print('username=%s' % secret_item['username'])
        print('password=%s' % secret_item['password'])
开发者ID:timhughes,项目名称:git-credential-libsecret,代码行数:18,代码来源:git-credential-libsecret.py

示例9: testSyncNotFound

# 需要导入模块: from gi.repository import Secret [as 别名]
# 或者: from gi.repository.Secret import password_lookup_sync [as 别名]
	def testSyncNotFound(self):
		password = Secret.password_lookup_sync (STORE_SCHEMA, { "number": "5", "even": "true" }, None)
		self.assertEqual(None, password)
开发者ID:Pusenka,项目名称:libsecret,代码行数:5,代码来源:test-lookup-password.py

示例10: testSynchronous

# 需要导入模块: from gi.repository import Secret [as 别名]
# 或者: from gi.repository.Secret import password_lookup_sync [as 别名]
	def testSynchronous(self):
		password = Secret.password_lookup_sync (STORE_SCHEMA, { "number": "1", "even": "false" }, None)
		self.assertEqual("111", password)
开发者ID:Pusenka,项目名称:libsecret,代码行数:5,代码来源:test-lookup-password.py

示例11: get_account_password

# 需要导入模块: from gi.repository import Secret [as 别名]
# 或者: from gi.repository.Secret import password_lookup_sync [as 别名]
def get_account_password(email):
    return Secret.password_lookup_sync(_ACCOUNT_SCHEMA, {"email": email}, None) or ''
开发者ID:NightBuilder,项目名称:pithos,代码行数:4,代码来源:util.py


注:本文中的gi.repository.Secret.password_lookup_sync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。