(accountText, rconn, spiderName, cookie)
更新一个账号的Cookie
更新一个账号的Cookie
更新一个账号的Cookie
def updateCookie(accountText, rconn, spiderName, cookie):
    """ 更新一个账号的Cookie """
    account = accountText.split("--")[0]
    #pdb.set_trace()
    new_cookie = UpdateCookie(account, cookie)
    if len(new_cookie) > 0:
        logger.warning("The cookie of %s has been updated successfully!" % account)
        rconn.set("%s:Cookies:%s" % (spiderName, accountText), new_cookie)
    else:
        logger.warning("The cookie of %s updated failed! Remove it!" % accountText)
        removeCookie(accountText, rconn, spiderName)
def updateCookie ( accountText , rconn , spiderName , cookie ) : account = accountText . split ( "--" ) [ 0 ] #pdb.set_trace() new_cookie = UpdateCookie ( account , cookie ) if len ( new_cookie ) > 0 : logger . warning ( "The cookie of %s has been updated successfully!" % account ) rconn . set ( "%s:Cookies:%s" % ( spiderName , accountText ) , new_cookie ) else : logger . warning ( "The cookie of %s updated failed! Remove it!" % accountText ) removeCookie ( accountText , rconn , spiderName )