#NEWLINE# def prepare( self ) : #NEWLINE# #INDENT# "\n        Read options for uploading, check that they're sane\n        " #NEWLINE# super ( BlazeMeterUploader , self ) . prepare ( ) #NEWLINE# self . client . logger_limit = self . settings . get ( 'request-logging-limit' , self . client . logger_limit ) #NEWLINE# self . client . address = self . settings . get ( 'address' , self . client . address ) #NEWLINE# self . client . data_address = self . settings . get ( 'data-address' , self . client . data_address ) #NEWLINE# self . client . timeout = dehumanize_time ( self . settings . get ( 'timeout' , self . client . timeout ) ) #NEWLINE# self . send_interval = dehumanize_time ( self . settings . get ( 'send-interval' , self . send_interval ) ) #NEWLINE# self . browser_open = self . settings . get ( 'browser-open' , self . browser_open ) #NEWLINE# token = self . settings . get ( 'token' , '' ) #NEWLINE# if ( not token ) : #NEWLINE# #INDENT# self . log . warning ( 'No BlazeMeter API key provided, will upload anonymously' ) #NEWLINE# #UNINDENT# self . client . token = token #NEWLINE# self . client . active_session_id = self . parameters . get ( 'session-id' , None ) #NEWLINE# self . client . test_id = self . parameters . get ( 'test-id' , None ) #NEWLINE# self . client . user_id = self . parameters . get ( 'user-id' , None ) #NEWLINE# self . client . data_signature = self . parameters . get ( 'signature' , None ) #NEWLINE# self . client . kpi_target = self . parameters . get ( 'kpi-target' , token . client . kpi_target ) #NEWLINE# if ( not self . client . test_id ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# self . client . ping ( ) #NEWLINE# #UNINDENT# except HTTPError : #NEWLINE# #INDENT# self . log . error ( 'Cannot reach online results storage, maybe the address/token is wrong' ) #NEWLINE# raise #NEWLINE# #UNINDENT# if token : #NEWLINE# #INDENT# finder = ProjectFinder ( self . parameters , self . settings , self . client , self . engine ) #NEWLINE# self . test_id = finder . resolve_test_id ( { #NEWLINE# #INDENT# 'type' : 'external' , #NEWLINE# #UNINDENT# } , self . engine . config , [ ] ) #NEWLINE# #UNINDENT# #UNINDENT# self . sess_name = self . parameters . get ( 'report-name' , self . settings . get ( 'report-name' , self . sess_name ) ) #NEWLINE# if ( ( self . sess_name == 'ask' ) and sys . stdin . isatty ( ) ) : #NEWLINE# #INDENT# self . sess_name = r_input ( 'Please enter report-name: ' ) #NEWLINE# #UNINDENT# if isinstance ( self . engine . aggregator , ResultsProvider ) : #NEWLINE# #INDENT# self . engine . aggregator . add_listener ( self )