user.py 文件源码

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

项目:sodogetip 作者: just-an-dev 项目源码 文件源码
def add_address(username, address, active=True):
        # sanitize (just lower)
        username = str(unicode(username).lower())

        db = TinyDB(config.user_file)
        table = db.table(username)

        # check if address not already exist
        user_db = Query()
        data = table.count(user_db.address == address)

        if data == 0:
            table.insert({"type": "simple", "address": address, "coin": "doge", "enable": False})

            if active is True:
                UserStorage.active_user_address(username, address)
        else:
            bot_logger.logger.error("address %s already registered for  %s " % (str(address), str(username)))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号