5 def createDB(folder, sqlite, currents):
6 """Create sqlite file with DCS currents"""
8 os.environ[
'CLING_STANDARD_PCH'] =
'none'
9 from PyCool
import cool
10 from CoolConvUtilities
import AtlCoolLib, AtlCoolTool
13 if os.path.isfile(sqlite):
17 f
'sqlite://;schema={sqlite};dbname=CONDBR2')
18 spec = cool.RecordSpecification()
19 spec.extend(
"value", cool.StorageType.Float)
20 spec.extend(
"quality_invalid", cool.StorageType.Bool)
21 f = AtlCoolLib.ensureFolder(
22 db, folder, spec, AtlCoolLib.athenaDesc(
True,
'CondAttrListCollection'))
25 sol = cool.Record(spec)
27 sol[
'quality_invalid'] =
False
28 tor = cool.Record(spec)
30 tor[
'quality_invalid'] =
False
31 f.storeObject(v[0], cool.ValidityKeyMax, sol, 1)
32 f.storeObject(v[0], cool.ValidityKeyMax, tor, 3)
35 act = AtlCoolTool.AtlCoolTool(db)
36 print(act.more(folder))