def new_parser_harness(results_dirpath):
 if (not path.exists(results_dirpath)):
  raise BadResultsDirectoryError
 keyval_path = path.join(results_dirpath, KEYVAL)
 job_keyval = utils.read_keyval(keyval_path)
 status_version = job_keyval[STATUS_VERSION]
 parser = status_lib.parser(status_version)
 job = parser.make_job(results_dirpath)
 status_log_filepath = path.join(results_dirpath, 'status.log')
 if (not path.exists(status_log_filepath)):
  raise BadResultsDirectoryError
 return ParserHarness(parser, job, job_keyval, status_version, status_log_filepath)

def new_parser_harness ( results_dirpath ) : if ( not path . exists ( results_dirpath ) ) : raise BadResultsDirectoryError keyval_path = path . join ( results_dirpath , KEYVAL ) job_keyval = utils . read_keyval ( keyval_path ) status_version = job_keyval [ STATUS_VERSION ] parser = status_lib . parser ( status_version ) job = parser . make_job ( results_dirpath ) status_log_filepath = path . join ( results_dirpath , 'status.log' ) if ( not path . exists ( status_log_filepath ) ) : raise BadResultsDirectoryError return ParserHarness ( parser , job , job_keyval , status_version , status_log_filepath )
ensure sane environment and create new parser with wrapper .