def ExtractToken(url, scopes_included_in_next=True):
 parsed = urlparse.urlparse(url)
 token = gdata.auth.AuthSubTokenFromUrl(parsed[4])
 scopes = ''
 if scopes_included_in_next:
  for pair in parsed[4].split('&'):
   if pair.startswith(('%s=' % SCOPE_URL_PARAM_NAME)):
    scopes = urllib.unquote_plus(pair.split('=')[1])
 return (token, scopes.split(' '))

def ExtractToken ( url , scopes_included_in_next = True ) : parsed = urlparse . urlparse ( url ) token = gdata . auth . AuthSubTokenFromUrl ( parsed [ 4 ] ) scopes = '' if scopes_included_in_next : for pair in parsed [ 4 ] . split ( '&' ) : if pair . startswith ( ( '%s=' % SCOPE_URL_PARAM_NAME ) ) : scopes = urllib . unquote_plus ( pair . split ( '=' ) [ 1 ] ) return ( token , scopes . split ( ' ' ) )
gets the authsub token from the current pages url .