<s> from app . util . event_log import EventLog <EOL> from app . util . exceptions import ItemNotReadyError <EOL> BUILD_REQUEST_QUEUED = '<STR_LIT>' <EOL> BUILD_PREPARE_START = '<STR_LIT>' <EOL> BUILD_PREPARE_FINISH = '<STR_LIT>' <EOL> BUILD_SETUP_START = '<STR_LIT>' <EOL> BUILD_SETUP_FINISH = '<STR_LIT>' <EOL> MASTER_RECEIVED_RESULT = '<STR_LIT>' <EOL> MASTER_TRIGGERED_SUBJOB = '<STR_LIT>' <EOL> SERVICE_STARTED = '<STR_LIT>' <EOL> SUBJOB_EXECUTION_FINISH = '<STR_LIT>' <EOL> SUBJOB_EXECUTION_START = '<STR_LIT>' <EOL> ATOM_START = '<STR_LIT>' <EOL> ATOM_FINISH = '<STR_LIT>' <EOL> _event_log = None <EOL> def initialize ( eventlog_file = None ) : <EOL> """<STR_LIT>""" <EOL> global _event_log <EOL> _event_log = EventLog ( filename = eventlog_file ) <EOL> def record_event ( tag , log_msg = None , ** event_data ) : <EOL> """<STR_LIT>""" <EOL> if _event_log : <EOL> _event_log . record_event ( tag , log_msg = log_msg , ** event_data ) <EOL> def get_events ( since_timestamp = None , since_id = None ) : <EOL> """<STR_LIT>""" <EOL> if _event_log : <EOL> since_timestamp = float ( since_timestamp ) if since_timestamp else since_timestamp <EOL> since_id = int ( since_id ) if since_id else since_id <EOL> return _event_log . get_events ( since_timestamp = since_timestamp , since_id = since_id ) <EOL> else : <EOL> raise ItemNotReadyError ( '<STR_LIT>' ) </s>
