CMS 3D CMS Logo

Functions | Variables
checkDictionaryUpdate Namespace Reference

Functions

def main (args)
 
def policyChecks (document)
 
def updatePolicyChecks (reference, update)
 

Variables

 action
 
 args
 
 DATAFORMATS_CHANGED
 
 description
 
 help
 
 NO_CHANGES
 
 parser
 
 POLICY_VIOLATION
 
 required
 
 str
 
 True
 
 type
 

Function Documentation

◆ main()

def checkDictionaryUpdate.main (   args)

Definition at line 22 of file checkDictionaryUpdate.py.

References policyChecks(), print(), and updatePolicyChecks().

22 def main(args):
23  with open(args.baseline) as f:
24  baseline = json.load(f)
25 
26  if args.pr is not None:
27  with open(args.pr) as f:
28  pr = json.load(f)
29  pc1 = policyChecks(pr)
30  if baseline != pr:
31  pc2 = updatePolicyChecks(baseline, pr)
32  if not (pc1 and pc2):
33  return POLICY_VIOLATION
34 
35  print("Changes in persistable data formats")
36  return DATAFORMATS_CHANGED
37  if not pc1:
38  return POLICY_VIOLATION
39  else:
40  if not policyChecks(baseline):
41  return POLICY_VIOLATION
42 
43  return NO_CHANGES
44 
def updatePolicyChecks(reference, update)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47

◆ policyChecks()

def checkDictionaryUpdate.policyChecks (   document)
Check policies on dictionary definitions. Return True if checks are fine.

Definition at line 12 of file checkDictionaryUpdate.py.

Referenced by main().

12 def policyChecks(document):
13  """Check policies on dictionary definitions. Return True if checks are fine."""
14  # Contents to be added later
15  return True
16 

◆ updatePolicyChecks()

def checkDictionaryUpdate.updatePolicyChecks (   reference,
  update 
)
Check policies on dictionary updates. Return True if checks are fine.

Definition at line 17 of file checkDictionaryUpdate.py.

Referenced by main().

17 def updatePolicyChecks(reference, update):
18  """Check policies on dictionary updates. Return True if checks are fine."""
19  # Contents to be added later
20  return True
21 
def updatePolicyChecks(reference, update)

Variable Documentation

◆ action

checkDictionaryUpdate.action

Definition at line 50 of file checkDictionaryUpdate.py.

◆ args

checkDictionaryUpdate.args

Definition at line 52 of file checkDictionaryUpdate.py.

◆ DATAFORMATS_CHANGED

checkDictionaryUpdate.DATAFORMATS_CHANGED

Definition at line 9 of file checkDictionaryUpdate.py.

◆ description

checkDictionaryUpdate.description

Definition at line 46 of file checkDictionaryUpdate.py.

◆ help

checkDictionaryUpdate.help

Definition at line 48 of file checkDictionaryUpdate.py.

◆ NO_CHANGES

checkDictionaryUpdate.NO_CHANGES

Definition at line 8 of file checkDictionaryUpdate.py.

◆ parser

checkDictionaryUpdate.parser

Definition at line 46 of file checkDictionaryUpdate.py.

◆ POLICY_VIOLATION

checkDictionaryUpdate.POLICY_VIOLATION

Definition at line 10 of file checkDictionaryUpdate.py.

◆ required

checkDictionaryUpdate.required

Definition at line 48 of file checkDictionaryUpdate.py.

◆ str

checkDictionaryUpdate.str

Definition at line 48 of file checkDictionaryUpdate.py.

◆ True

checkDictionaryUpdate.True

Definition at line 48 of file checkDictionaryUpdate.py.

◆ type

checkDictionaryUpdate.type

Definition at line 48 of file checkDictionaryUpdate.py.