CLI_helper.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:competitive-cli 作者: GDGVIT 项目源码 文件源码
def delete(self, key):
        key = str(key)
        if key not in self.data["accounts"]:
            print("Account with given index does not exist")
            return
        return_value = self.data["accounts"].pop(key)
        account_keys = [int(indices) for indices in self.data["accounts"].keys() if int(indices)>int(key)]
        for indices in account_keys:
            temp_value = self.data["accounts"].pop(str(indices))
            self.data["accounts"][str(indices-1)] = temp_value

            if self.account == indices: self.account -= 1

        self.number_of_accounts -= 1

        if self.account == int(key): self.account = None
        keyring.delete_password(*return_value)

        return key,return_value
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号