def GenerateOAuthAuthorizationUrl(request_token, authorization_url='https://www.google.com/accounts/OAuthAuthorizeToken', callback_url=None, extra_params=None, include_scopes_in_callback=False, scopes_param_prefix='oauth_token_scope'):
 scopes = request_token.scopes
 if isinstance(scopes, list):
  scopes = ' '.join(scopes)
 if (include_scopes_in_callback and callback_url):
  if (callback_url.find('?') > (-1)):
   callback_url += '&'
  else:
   callback_url += '?'
  callback_url += urllib.urlencode({scopes_param_prefix: scopes})
 oauth_token = oauth.OAuthToken(request_token.key, request_token.secret)
 oauth_request = oauth.OAuthRequest.from_token_and_callback(token=oauth_token, callback=callback_url, http_url=authorization_url, parameters=extra_params)
 return atom.url.parse_url(oauth_request.to_url())

def GenerateOAuthAuthorizationUrl ( request_token , authorization_url = 'https://www.google.com/accounts/OAuthAuthorizeToken' , callback_url = None , extra_params = None , include_scopes_in_callback = False , scopes_param_prefix = 'oauth_token_scope' ) : scopes = request_token . scopes if isinstance ( scopes , list ) : scopes = ' ' . join ( scopes ) if ( include_scopes_in_callback and callback_url ) : if ( callback_url . find ( '?' ) > ( - 1 ) ) : callback_url += '&' else : callback_url += '?' callback_url += urllib . urlencode ( { scopes_param_prefix : scopes } ) oauth_token = oauth . OAuthToken ( request_token . key , request_token . secret ) oauth_request = oauth . OAuthRequest . from_token_and_callback ( token = oauth_token , callback = callback_url , http_url = authorization_url , parameters = extra_params ) return atom . url . parse_url ( oauth_request . to_url ( ) )
generates url at which user will login to authorize the request token .