7 """Simple script to create an 'empty' OKS file.
8 The file will automatically include the confmodel schema
9 and any other OKS files you specify"""
11 includefiles = [
"schema/confmodel/dunedaq.schema.xml"]
13 searchdirs = [path
for path
in os.environ[
"DUNEDAQ_DB_PATH"].split(
":")]
14 searchdirs.append(os.path.dirname(oksfile))
18 inc = inc.removesuffix(
".xml")
19 if inc.endswith(
".data"):
21 elif inc.endswith(
".schema"):
26 for path
in searchdirs:
27 matches = glob.glob(f
"{inc}.xml", root_dir=path)
29 matches = glob.glob(f
"{ftype}/{inc}.xml", root_dir=path)
30 for filename
in matches:
31 print(f
"Adding {filename} to include list")
32 includefiles.append(filename)
37 print(f
"Error could not find include file for {inc}")
40 if not oksfile.endswith(
".data.xml"):
41 oksfile = oksfile +
".data.xml"
42 print(f
"Creating OKS database file {oksfile}")
43 db.create_db(oksfile, includefiles)