CMS 3D CMS Logo

edmMakeDummyCfis.py
Go to the documentation of this file.
1 from pathlib import Path
2 import os
3 import sys
4 from FWCore.ParameterSet.DummyCfis import create_cfis
5 
6 
7 
8 if __name__ == "__main__":
9  import argparse
10 
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")
18 
19  options = parser.parse_args()
20 
21 
22  base = Path(options.cfipythondir)
23 
24  work = Path.cwd() / 'cfis'
25  work.mkdir()
26  os.chdir(work)
27  for subsys in (x for x in base.iterdir() if x.is_dir()):
28  newSub = work /subsys.name
29  newSub.mkdir()
30  os.chdir(newSub)
31  for pkg in (y for y in subsys.iterdir() if y.is_dir()):
32  newPkg = newSub / pkg.name
33  newPkg.mkdir()
34  os.chdir(newPkg)
35  if (pkg / "modules.py").exists():
36  create_cfis(subsys.name + '.'+pkg.name, writeRequired=options.required, writeOptional=options.optional)
def create_cfis
Definition: DummyCfis.py:38