Functions | Variables
update_snapshots Namespace Reference

Functions

def UpdateDefinitionReferences (defn, depth=0, already_snapshotted=[])
 

Variables

 SAM
 
 experiment
 
 DEFN_PATTERN
 
 parser
 
 prog
 
 description
 
 metavar
 
 nargs
 
 help
 
 args
 
 defns
 

Function Documentation

def update_snapshots.UpdateDefinitionReferences (   defn,
  depth = 0,
  already_snapshotted = [] 
)

Definition at line 16 of file update_snapshots.py.

16 def UpdateDefinitionReferences(defn, depth=0, already_snapshotted=[]):
17  if defn in already_snapshotted:
18  return
19 
20  padding = " " * (depth * 3)
21  print padding, "Updating definition:", defn
22 
23  try:
24  defn_info = SAM.descDefinitionDict(defn)
26  print padding, " ==> definition not found. Skipping"
27  return
28 
29  dims = defn_info["dimensions"]
30  matches = re.findall(DEFN_PATTERN, dims)
31  if matches:
32  for match in matches:
33  match = match[1] # second parenthesized group in pattern
34  UpdateDefinitionReferences(match, depth+1, already_snapshotted)
35 
36  print padding, " samweb take-snapshot", defn
37  SAM.takeSnapshot(defn)
38  already_snapshotted.append(defn)
39 
40 
def UpdateDefinitionReferences(defn, depth=0, already_snapshotted=[])

Variable Documentation

update_snapshots.args

Definition at line 48 of file update_snapshots.py.

update_snapshots.DEFN_PATTERN

Definition at line 14 of file update_snapshots.py.

update_snapshots.defns

Definition at line 50 of file update_snapshots.py.

update_snapshots.description

Definition at line 41 of file update_snapshots.py.

update_snapshots.experiment

Definition at line 12 of file update_snapshots.py.

update_snapshots.help

Definition at line 45 of file update_snapshots.py.

update_snapshots.metavar

Definition at line 43 of file update_snapshots.py.

update_snapshots.nargs

Definition at line 44 of file update_snapshots.py.

update_snapshots.parser

Definition at line 41 of file update_snapshots.py.

update_snapshots.prog

Definition at line 41 of file update_snapshots.py.

update_snapshots.SAM

Definition at line 12 of file update_snapshots.py.