app_engine.py 文件源码

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

项目:GAMADV-XTD 作者: taers232c 项目源码 文件源码
def get_token(unique_key):
  """Searches for a stored token with the desired key.

  Checks memcache and then the datastore if required.

  Args:
    unique_key: str which uniquely identifies the desired auth token.

  Returns:
    A string encoding the auth token data. Use gdata.gauth.token_from_blob to
    convert back into a usable token object. None if the token was not found
    in memcache or the datastore.
  """
  token_string = memcache.get(unique_key)
  if token_string is None:
    # The token wasn't in memcache, so look in the datastore.
    token = Token.get_by_key_name(unique_key)
    if token is None:
      return None
    return token.t
  return token_string
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号