userinfo_utility.py 文件源码

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

项目:ifttt-line 作者: MypaceEngine 项目源码 文件源码
def setUserByDashIdWithCurrentUser(dashId):
    # if not exists, assign the dashId to lineId
    result = False
    currentUser = _getCurrentUser()

    if currentUser != None:
        # memcache.set(key = "Dash-user-"+dashid,value=currentUser, time=86400)
        # memcache.set(key = "User-dash-"+currentUser,value=dashid, time=86400 )
        logging.debug(dashId + u"?DashButton???????????")

        try:
            lineId = currentUser
            key = db.Key.from_path('UserData', lineId)
            userData = db.get(key)
            userData.dashId = dashId
            userData.put()
            found_lineId = lineId
            _clearCurrentUser()
            send2Line.sendText(currentUser, "DashButton????????")
            result = True
        except:
            logging.warning(u"currentUser???????" + lineId + u"???????????")

    else:
        logging.warning(u"currentUser??????????????????????")

    return result
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号