def load_results_dir(package_dirpath):
 tgz_filepath = path.join(package_dirpath, RESULTS_DIR_TARBALL)
 if (not path.exists(tgz_filepath)):
  return (None, None)
 tgz = tarfile.open(tgz_filepath, 'r:gz')
 tmp_dirpath = autotemp.tempdir(unique_id='scenario_base')
 results_dirname = tgz.next().name
 tgz.extract(results_dirname, tmp_dirpath.name)
 for info in tgz:
  tgz.extract(info.name, tmp_dirpath.name)
 return (tmp_dirpath, path.join(tmp_dirpath.name, results_dirname))

def load_results_dir ( package_dirpath ) : tgz_filepath = path . join ( package_dirpath , RESULTS_DIR_TARBALL ) if ( not path . exists ( tgz_filepath ) ) : return ( None , None ) tgz = tarfile . open ( tgz_filepath , 'r:gz' ) tmp_dirpath = autotemp . tempdir ( unique_id = 'scenario_base' ) results_dirname = tgz . next ( ) . name tgz . extract ( results_dirname , tmp_dirpath . name ) for info in tgz : tgz . extract ( info . name , tmp_dirpath . name ) return ( tmp_dirpath , path . join ( tmp_dirpath . name , results_dirname ) )
unpack results tarball in package_dirpath to temp dir .