history.py 文件源码

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

项目:sodogetip 作者: just-an-dev 项目源码 文件源码
def add_to_history_tip(user_history, action, tip):
        # convert object to string of name if necessary
        if type(user_history) is models.User:
            user_history = user_history.username

        bot_logger.logger.info("Save for history user=%s, sender=%s, receiver=%s, amount=%s, action=%s, finish=%s" % (
            user_history, tip.sender.username, tip.receiver.username, tip.amount, action, tip.finish))

        db = TinyDB(config.history_path + user_history + '.json')
        db.insert({
            "user": user_history,
            "id": tip.id,
            "sender": tip.sender.username,
            "receiver": tip.receiver.username,
            "amount": tip.amount,
            "action": action,
            "finish": tip.finish,
            "status": tip.status,
            "tx_id": tip.tx_id,
            'time': tip.time,
        })
        db.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号