def mergefiles(self, file_list, output_file): # if no opts file is specified, then use version from installation # this is the bit specifing the files output_opts = """ outputfile = '%s' """ % output_file output_opts += "\ninput = [" file_sep = ',' for f in file_list: if f is file_list[-1]: file_sep = '' output_opts += "'%s' %s " % (f, file_sep) output_opts += "]" output_opts += """ from GaudiConf import IOHelper IOHelper().inputFiles(input) IOHelper().outStream(outputfile,"InputCopyStream") from Configurables import LHCbApp LHCbApp().EvtMax = -1 """ # write this out to a file opts_file_name = tempfile.mktemp('.py') opts_file = file(opts_file_name, 'w') try: opts_file = file(opts_file_name, 'w') opts_file.write(output_opts) finally: opts_file.close() if not os.path.exists(opts_file_name): msg = "Failed to write temporary options file '%s' during merge" raise PostProcessException(msg % opts_file_name) import EnvironFunctions script_file_name = EnvironFunctions.construct_merge_script(self.version, opts_file_name) return_code = subprocess.call(['/bin/sh', script_file_name]) if return_code != 0: msg = 'The LHCbFileMerger returned %i when calling gaudirun' logger.warning(msg % return_code) # finally clean up os.unlink(script_file_name) os.unlink(opts_file_name) if not os.path.exists(output_file): msg = "The output file '%s' was not created" raise PostProcessException(msg % output_file)
def _getshell(self): import EnvironFunctions return EnvironFunctions._getshell(self)
def _getshell(self): import EnvironFunctions env = EnvironFunctions._getshell(self) return env
def guess_version(self, appname): """Guess the default Gaudi application version""" import EnvironFunctions return EnvironFunctions.guess_version(self, appname)
def available_versions(self, appname): """Provide a list of the available Gaudi application versions""" import EnvironFunctions return EnvironFunctions.available_versions(self, appname)