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


Python GnomeKeyring.item_delete_sync方法代码示例

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


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

示例1: remove_by_id

# 需要导入模块: from gi.repository import GnomeKeyring [as 别名]
# 或者: from gi.repository.GnomeKeyring import item_delete_sync [as 别名]
 def remove_by_id(self, uid):
     """
         Remove an account by uid
         :param uid: (int) account uid
         :return:
     """
     secret_code = self.get_secret_code(uid)
     if secret_code:
         found = False
         (result, ids) = GK.list_item_ids_sync("TwoFactorAuth")
         for gid in ids:
             (result, item) = GK.item_get_info_sync("TwoFactorAuth", gid)
             if result == GK.Result.OK:
                 if item.get_display_name().strip("'") == secret_code:
                     found = True
                     break
         if found:
             GK.item_delete_sync("TwoFactorAuth", gid)
     query = "DELETE FROM accounts WHERE uid=?"
     try:
         self.conn.execute(query, (uid,))
         self.conn.commit()
     except Exception as e:
         logging.error(
             "SQL: Couldn't remove account by uid : %s with error : %s" % (uid, str(e)))
开发者ID:emersion,项目名称:Gnome-TwoFactorAuth,代码行数:27,代码来源:database.py

示例2: delete_credentials

# 需要导入模块: from gi.repository import GnomeKeyring [as 别名]
# 或者: from gi.repository.GnomeKeyring import item_delete_sync [as 别名]
 def delete_credentials(self, user):
     attrs = attributes({
                         "user": user,
                         "server": self._server,
                         "protocol": self._protocol
                         })
     result, items = GnomeKeyring.find_items_sync(GnomeKeyring.ItemType.NETWORK_PASSWORD, attrs)
     for item in items:
         GnomeKeyring.item_delete_sync(self._keyring, item.item_id)
开发者ID:balbusm,项目名称:gm-notify,代码行数:11,代码来源:gm_notify_keyring.py

示例3: _migrate_keyring

# 需要导入模块: from gi.repository import GnomeKeyring [as 别名]
# 或者: from gi.repository.GnomeKeyring import item_delete_sync [as 别名]
	def _migrate_keyring(self):
		attrs = GnomeKeyring.Attribute.list_new()
		GnomeKeyring.Attribute.list_append_string(attrs, 'application', 'Mailnag')
		result, items = GnomeKeyring.find_items_sync(GnomeKeyring.ItemType.GENERIC_SECRET, attrs)
		
		if result == GnomeKeyring.Result.OK:
			for i in items:
				result, info = GnomeKeyring.item_get_info_sync(self._defaultKeyring, i.item_id)
				self.set(info.get_display_name(), i.secret)
				GnomeKeyring.item_delete_sync(self._defaultKeyring, i.item_id)
开发者ID:Mailaender,项目名称:mailnag,代码行数:12,代码来源:credentialstore.py

示例4: remove_credentials

# 需要导入模块: from gi.repository import GnomeKeyring [as 别名]
# 或者: from gi.repository.GnomeKeyring import item_delete_sync [as 别名]
 def remove_credentials(self, acc):
     self.lock.acquire()
     try:
         logger.debug("Removing credentias from gnome keyring for the account: %s" % (acc.get_name()))
         if hasattr(acc, "keyringid"):
             gk.item_delete_sync(self._KEYRING_NAME, int(acc.keyringid))
             logger.debug("Credentials removed")
         else:
             logger.debug("The account has not credentials asigned, continue")
     finally:
         self.lock.release()
开发者ID:akwala,项目名称:cloud-services-notifications,代码行数:13,代码来源:gkeyring.py

示例5: remove

# 需要导入模块: from gi.repository import GnomeKeyring [as 别名]
# 或者: from gi.repository.GnomeKeyring import item_delete_sync [as 别名]
	def remove(self, accounts):
		# create list of all valid accounts
		valid_accounts = []
		for acc in accounts:
			protocol = 'imap' if acc.imap else 'pop'
			valid_accounts.append(self.KEYRING_ITEM_NAME % \
			(protocol, acc.user, acc.server))

		# find and delete invalid entries
		(result, ids) = GnomeKeyring.list_item_ids_sync(self._defaultKeyring)
		if result == GnomeKeyring.Result.OK:
			displayNameDict = {}
			for identity in ids:
				(result, item) = GnomeKeyring.item_get_info_sync(self._defaultKeyring, identity)
				displayNameDict[item.get_display_name()] = identity
			for key in displayNameDict.keys():
				if key.startswith('Mailnag password for') \
				and key not in valid_accounts:
					GnomeKeyring.item_delete_sync(self._defaultKeyring, displayNameDict[key])
开发者ID:mikeit,项目名称:mailnag,代码行数:21,代码来源:keyring.py

示例6: delete_password

# 需要导入模块: from gi.repository import GnomeKeyring [as 别名]
# 或者: from gi.repository.GnomeKeyring import item_delete_sync [as 别名]
 def delete_password(self, service, username):
     """Delete the password for the username of the service.
     """
     items = self._find_passwords(service, username, deleting=True)
     if not items:
         raise PasswordDeleteError("Password not found")
     for current in items:
         result = GnomeKeyring.item_delete_sync(current.keyring, current.item_id)
         if result == GnomeKeyring.Result.CANCELLED:
             raise PasswordDeleteError("Cancelled by user")
         elif result != GnomeKeyring.Result.OK:
             raise PasswordDeleteError(result.value_name)
开发者ID:Jelloeater,项目名称:NetworkMonitor,代码行数:14,代码来源:Gnome.py

示例7: delete_password

# 需要导入模块: from gi.repository import GnomeKeyring [as 别名]
# 或者: from gi.repository.GnomeKeyring import item_delete_sync [as 别名]
 def delete_password(self, service, username):
     """Delete the password for the username of the service.
     """
     from gi.repository import GnomeKeyring
     attrs = GnomeKeyring.Attribute.list_new()
     GnomeKeyring.Attribute.list_append_string(attrs, 'username', username)
     GnomeKeyring.Attribute.list_append_string(attrs, 'domain', service)
     result, items = GnomeKeyring.find_items_sync(
         GnomeKeyring.ItemType.NETWORK_PASSWORD, attrs)
     if result == GnomeKeyring.Result.NO_MATCH:
         raise PasswordDeleteError("Password not found")
     for current in items:
         result = GnomeKeyring.item_delete_sync(current.keyring,
                                                current.item_id)
         if result == GnomeKeyring.Result.CANCELLED:
             raise PasswordDeleteError("Cancelled by user")
开发者ID:pschmitt,项目名称:python-keyring-lib-keyring,代码行数:18,代码来源:Gnome.py

示例8: do_delete

# 需要导入模块: from gi.repository import GnomeKeyring [as 别名]
# 或者: from gi.repository.GnomeKeyring import item_delete_sync [as 别名]
 def do_delete(self, id):
     keyring = GnomeKeyring.get_default_keyring_sync()[1]
     GnomeKeyring.item_delete_sync(keyring, id)
开发者ID:tiwoc,项目名称:liferea,代码行数:5,代码来源:gnome-keyring.py

示例9: remove

# 需要导入模块: from gi.repository import GnomeKeyring [as 别名]
# 或者: from gi.repository.GnomeKeyring import item_delete_sync [as 别名]
	def remove(self, key):
		attrs = self._get_attrs(key)
		result, items = GnomeKeyring.find_items_sync(GnomeKeyring.ItemType.GENERIC_SECRET, attrs)
		
		if result == GnomeKeyring.Result.OK:
			GnomeKeyring.item_delete_sync(self._defaultKeyring, items[0].item_id)
开发者ID:Mailaender,项目名称:mailnag,代码行数:8,代码来源:credentialstore.py

示例10: del_from_keyring

# 需要导入模块: from gi.repository import GnomeKeyring [as 别名]
# 或者: from gi.repository.GnomeKeyring import item_delete_sync [as 别名]
def del_from_keyring(keyring_id):
  """Delete an entry from the keyring."""
  keyring = GnomeKeyring.get_default_keyring_sync()[1]
  GnomeKeyring.item_delete_sync(keyring, keyring_id)
开发者ID:thnguyn2,项目名称:ECE_527_MP,代码行数:6,代码来源:keyring.py

示例11: removeEncriptedFolder

# 需要导入模块: from gi.repository import GnomeKeyring [as 别名]
# 或者: from gi.repository.GnomeKeyring import item_delete_sync [as 别名]
	def removeEncriptedFolder(self,epath):
		id = self.find_folder(epath)
		if id != None:
			GnomeKeyring.item_delete_sync(self.keyring,id[0])
			return True
		return False
开发者ID:atareao,项目名称:cryptfolder-indicator,代码行数:8,代码来源:cfkeyringmanager.py


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