def auth_sub_string_from_url(url, scopes_param_prefix='auth_sub_scopes'):
 if isinstance(url, (str, unicode)):
  url = atom.http_core.Uri.parse_uri(url)
 if ('token' not in url.query):
  return (None, None)
 token = url.query['token']
 scopes = None
 if (scopes_param_prefix in url.query):
  scopes = tuple(url.query[scopes_param_prefix].split(' '))
 return (token, scopes)

def auth_sub_string_from_url ( url , scopes_param_prefix = 'auth_sub_scopes' ) : if isinstance ( url , ( str , unicode ) ) : url = atom . http_core . Uri . parse_uri ( url ) if ( 'token' not in url . query ) : return ( None , None ) token = url . query [ 'token' ] scopes = None if ( scopes_param_prefix in url . query ) : scopes = tuple ( url . query [ scopes_param_prefix ] . split ( ' ' ) ) return ( token , scopes )
finds the token string after the browser is redirected .