ATLAS Offline Software
Loading...
Searching...
No Matches
python.Node Namespace Reference

Classes

class  Node

Functions

 notDefined (flags, name)
 decode_flags (flags, domain=None)
 update_flags (flags, node, domain="")

Variables

int _UNLOCKED = 0
int _LOCKED = 1
int _LOCKED_FOREVER = 2

Function Documentation

◆ decode_flags()

decode_flags ( flags,
domain = None )
take an egregious  flags list and convert to a lovely tree 

Definition at line 248 of file Node.py.

248def decode_flags( flags, domain=None ) :
249 """ take an egregious flags list and convert to a lovely tree """
250 root = Node("root")
251
252 for tag, value in flags._flagdict.items():
253 root.addFlag( tag, value, flags )
254
255 return root
256
257
258
259

◆ notDefined()

notDefined ( flags,
name )
 check whether the flags have an actual item with this name
    NB using hasFlag(name) is really dengerous, as that seems to 
       actually evaluate any actual functions ? shouldn't 
       something like that be called testFlag() ? 

Definition at line 238 of file Node.py.

238def notDefined(flags, name):
239 """ check whether the flags have an actual item with this name
240 NB using hasFlag(name) is really dengerous, as that seems to
241 actually evaluate any actual functions ? shouldn't
242 something like that be called testFlag() ?
243 """
244 return name not in flags._flagdict
245
246
247

◆ update_flags()

update_flags ( flags,
node,
domain = "" )
take a lovely tree and convert to an egregious flags list, 
   only adding items that are not in the original flags list 

Definition at line 260 of file Node.py.

260def update_flags( flags, node, domain="" ) :
261 """ take a lovely tree and convert to an egregious flags list,
262 only adding items that are not in the original flags list """
263
264 for key, value in node.__dict__.items():
265 if key in {"_name","_children","_lockstate", "_flags", "_root" } : continue
266 name = f"{domain}.{key}"
267 if notDefined(flags,name) : flags.addFlag( name, value )
268
269 for n in node.nodes() :
270 if domain=="" : update_flags( flags, n, f"{n.name()}" )
271 else: update_flags( flags, n, f"{domain}.{n.name()}" )
272

Variable Documentation

◆ _LOCKED

int python.Node._LOCKED = 1
protected

Definition at line 24 of file Node.py.

◆ _LOCKED_FOREVER

int python.Node._LOCKED_FOREVER = 2
protected

Definition at line 25 of file Node.py.

◆ _UNLOCKED

int python.Node._UNLOCKED = 0
protected

Definition at line 23 of file Node.py.