@util.positional(2)
def flow_from_clientsecrets(filename, scope, redirect_uri=None, message=None, cache=None, login_hint=None, device_uri=None):
 try:
  (client_type, client_info) = clientsecrets.loadfile(filename, cache=cache)
  if (client_type in (clientsecrets.TYPE_WEB, clientsecrets.TYPE_INSTALLED)):
   constructor_kwargs = {'redirect_uri': redirect_uri, 'auth_uri': client_info['auth_uri'], 'token_uri': client_info['token_uri'], 'login_hint': login_hint}
   revoke_uri = client_info.get('revoke_uri')
   if (revoke_uri is not None):
    constructor_kwargs['revoke_uri'] = revoke_uri
   if (device_uri is not None):
    constructor_kwargs['device_uri'] = device_uri
   return OAuth2WebServerFlow(client_info['client_id'], client_info['client_secret'], scope, **constructor_kwargs)
 except clientsecrets.InvalidClientSecretsError:
  if message:
   sys.exit(message)
  else:
   raise
 else:
  raise UnknownClientSecretsFlowError(('This OAuth 2.0 flow is unsupported: %r' % client_type))

@ util . positional ( 2 ) def flow_from_clientsecrets ( filename , scope , redirect_uri = None , message = None , cache = None , login_hint = None , device_uri = None ) : try : ( client_type , client_info ) = clientsecrets . loadfile ( filename , cache = cache ) if ( client_type in ( clientsecrets . TYPE_WEB , clientsecrets . TYPE_INSTALLED ) ) : constructor_kwargs = { 'redirect_uri' : redirect_uri , 'auth_uri' : client_info [ 'auth_uri' ] , 'token_uri' : client_info [ 'token_uri' ] , 'login_hint' : login_hint } revoke_uri = client_info . get ( 'revoke_uri' ) if ( revoke_uri is not None ) : constructor_kwargs [ 'revoke_uri' ] = revoke_uri if ( device_uri is not None ) : constructor_kwargs [ 'device_uri' ] = device_uri return OAuth2WebServerFlow ( client_info [ 'client_id' ] , client_info [ 'client_secret' ] , scope , ** constructor_kwargs ) except clientsecrets . InvalidClientSecretsError : if message : sys . exit ( message ) else : raise else : raise UnknownClientSecretsFlowError ( ( 'This OAuth 2.0 flow is unsupported: %r' % client_type ) )
create a flow from a clientsecrets file .