#NEWLINE# def __call__( self , args ) : #NEWLINE# #INDENT# self . args = args #NEWLINE# if ( not self . args . secrets ) : #NEWLINE# #INDENT# home_path = os . path . expanduser ( '~/.clan_secrets.json' ) #NEWLINE# if os . path . exists ( 'client_secrets.json' ) : #NEWLINE# #INDENT# self . args . secrets = 'client_secrets.json' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if os . path . exists ( home_path ) : #NEWLINE# #INDENT# self . args . secrets = home_path #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise Exception ( 'Could not locate authentication secrets (client_secrets.json). Please create it or specify a different file using --secrets.' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# storage = Storage ( 'analytics.dat' ) #NEWLINE# flow = client . flow_from_clientsecrets ( flow . args . secrets , scope = 'https://www.googleapis.com/auth/analytics.readonly' ) #NEWLINE# tools . run_flow ( flow , storage , self . args )