<s> """<STR_LIT>""" <EOL> USAGE = """<STR_LIT>""" <EOL> import sys <EOL> if '<STR_LIT>' not in sys . modules and __name__ == '<STR_LIT:__main__>' : <EOL> import pythonpathsetter <EOL> from robotide . lib . robot . conf import RobotSettings <EOL> from robotide . lib . robot . model import ModelModifier <EOL> from robotide . lib . robot . output import LOGGER , pyloggingconf <EOL> from robotide . lib . robot . reporting import ResultWriter <EOL> from robotide . lib . robot . running import TestSuiteBuilder <EOL> from robotide . lib . robot . utils import Application <EOL> class RobotFramework ( Application ) : <EOL> def __init__ ( self ) : <EOL> Application . __init__ ( self , USAGE , arg_limits = ( <NUM_LIT:1> , ) , <EOL> env_options = '<STR_LIT>' , logger = LOGGER ) <EOL> def main ( self , datasources , ** options ) : <EOL> settings = RobotSettings ( options ) <EOL> LOGGER . register_console_logger ( ** settings . console_output_config ) <EOL> LOGGER . info ( '<STR_LIT>' % unicode ( settings ) ) <EOL> suite = TestSuiteBuilder ( settings [ '<STR_LIT>' ] , <EOL> settings [ '<STR_LIT>' ] ) . build ( * datasources ) <EOL> suite . configure ( ** settings . suite_config ) <EOL> if settings . pre_run_modifiers : <EOL> suite . visit ( ModelModifier ( settings . pre_run_modifiers , <EOL> settings . run_empty_suite , LOGGER ) ) <EOL> with pyloggingconf . robot_handler_enabled ( settings . log_level ) : <EOL> result = suite . run ( settings ) <EOL> LOGGER . info ( "<STR_LIT>" <EOL> % result . suite . stat_message ) <EOL> if settings . log or settings . report or settings . xunit : <EOL> writer = ResultWriter ( settings . output if settings . log <EOL> else result ) <EOL> writer . write_results ( settings . get_rebot_settings ( ) ) <EOL> return result . return_code <EOL> def validate ( self , options , arguments ) : <EOL> return self . _filter_options_without_value ( options ) , arguments <EOL> def _filter_options_without_value ( self , options ) : <EOL> return dict ( ( name , value ) for name , value in options . items ( ) <EOL> if value not in ( None , [ ] ) ) <EOL> def run_cli ( arguments ) : <EOL> """<STR_LIT>""" <EOL> RobotFramework ( ) . execute_cli ( arguments ) <EOL> def run ( * datasources , ** options ) : <EOL> """<STR_LIT>""" <EOL> return RobotFramework ( ) . execute ( * datasources , ** options ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> run_cli ( sys . argv [ <NUM_LIT:1> : ] ) </s>
