ATLAS Offline Software
Classes | Functions | Variables
python.virtual_mixin Namespace Reference

Classes

class  DefectsDBVirtualDefectsMixin
 

Functions

def _resolve_dependencies (node, resolved=None, unresolved=None)
 

Variables

 log
 
tuple NONHEAD_MODIFICATION_MSG
 

Function Documentation

◆ _resolve_dependencies()

def python.virtual_mixin._resolve_dependencies (   node,
  resolved = None,
  unresolved = None 
)
private
Navigate the node to determine dependencies. Circular references raise an 
exception.

Shamelessly stolen algorithm from:
http://www.electricmonk.nl/log/2008/08/07/dependency-resolving-algorithm/

Definition at line 17 of file virtual_mixin.py.

17 def _resolve_dependencies(node, resolved=None, unresolved=None):
18  """
19  Navigate the node to determine dependencies. Circular references raise an
20  exception.
21 
22  Shamelessly stolen algorithm from:
23  http://www.electricmonk.nl/log/2008/08/07/dependency-resolving-algorithm/
24  """
25  if resolved is None: resolved = []
26  if unresolved is None: unresolved = []
27  unresolved.append(node)
28  for dependency in node.dependencies:
29  if dependency not in resolved:
30  if dependency in unresolved:
31  raise Exception('Circular reference detected: %s -> %s'
32  % (node.name, dependency.name))
33  _resolve_dependencies(dependency, resolved, unresolved)
34 
35  resolved.append(node)
36  unresolved.remove(node)
37  return resolved
38 
39 

Variable Documentation

◆ log

python.virtual_mixin.log

Definition at line 3 of file virtual_mixin.py.

◆ NONHEAD_MODIFICATION_MSG

tuple python.virtual_mixin.NONHEAD_MODIFICATION_MSG
Initial value:
1 = ("Operations which modify virtual defects can only "
2  "be done on the HEAD tag.")

Definition at line 14 of file virtual_mixin.py.

python.virtual_mixin._resolve_dependencies
def _resolve_dependencies(node, resolved=None, unresolved=None)
Definition: virtual_mixin.py:17