+def get_config_file_path(job_config_name, l_cfg_dir):
+ found = False
+ file_jobs_cfg = None
+ if os.path.exists(job_config_name) and job_config_name.endswith(".pyconf"):
+ found = True
+ file_jobs_cfg = job_config_name
+ else:
+ for cfg_dir in l_cfg_dir:
+ file_jobs_cfg = os.path.join(cfg_dir, job_config_name)
+ if not file_jobs_cfg.endswith('.pyconf'):
+ file_jobs_cfg += '.pyconf'
+
+ if not os.path.exists(file_jobs_cfg):
+ continue
+ else:
+ found = True
+ break
+ return found, file_jobs_cfg
+
+def develop_factorized_jobs(config_jobs):
+ '''update information about the jobs for the file xml_file
+
+ :param config_jobs Config: the config corresponding to the jos description
+ '''
+ developed_jobs_list = []
+ for jb in config_jobs.jobs:
+ # case where the jobs are not developed
+ if type(jb.machine) == type(""):
+ developed_jobs_list.append(jb)
+ continue
+ # Case where the jobs must be developed
+ # Example:
+ # machine : ["CO7.2 physique", ["CO6.4 physique", $MONDAY, $TUESDAY ], "FD22"]
+ name_job = jb.name
+ for machine in jb.machine:
+ new_job = src.pyconf.deepCopyMapping(jb)
+ # case where there is a jobs on the machine corresponding to all
+ # days in when variable.
+ if type(machine) == type(""):
+ new_job.machine = machine
+ new_job.name = name_job + " / " + machine
+ else:
+ # case the days are re defined
+ new_job.machine = machine[0]
+ new_job.name = name_job + " / " + machine[0]
+ new_job.when = machine[1:]
+ developed_jobs_list.append(new_job)
+
+ config_jobs.jobs = developed_jobs_list
+