1 from pathlib
import Path
4 from FWCore.ParameterSet.DummyCfis
import create_cfis
8 if __name__ ==
"__main__":
11 parser = argparse.ArgumentParser(description=
"Expand python configuration")
12 parser.add_argument(
"cfipythondir",
13 help=
"cfipython dir for the configurations files to read")
14 parser.add_argument(
"--required", action=
"store_true",
15 help=
"Add dummy values for cms.required parameters")
16 parser.add_argument(
"--optional", action=
"store_true",
17 help=
"Add dummy values for cms.optional parameters")
19 options = parser.parse_args()
22 base =
Path(options.cfipythondir)
24 work = Path.cwd() /
'cfis' 27 for subsys
in (x
for x
in base.iterdir()
if x.is_dir()):
28 newSub = work /subsys.name
31 for pkg
in (y
for y
in subsys.iterdir()
if y.is_dir()):
32 newPkg = newSub / pkg.name
35 if (pkg /
"modules.py").exists():
36 create_cfis(subsys.name +
'.'+pkg.name, writeRequired=options.required, writeOptional=options.optional)