The Gaudi Framework  v30r3 (a5ef0a68)
GaudiKernel Namespace Reference

Namespaces

 Configurable
 
 ConfigurableDb
 
 ConfigurableMeta
 
 Constants
 
 DataObjectHandleBase
 
 GaudiHandles
 
 PhysicalConstants
 
 ProcessJobOptions
 
 PropertyProxy
 
 Proxy
 
 RootMap
 
 SystemOfUnits
 

Functions

def ROOT6WorkAroundEnabled (id=None)
 

Function Documentation

def GaudiKernel.ROOT6WorkAroundEnabled (   id = None)
Helper function to easily exclude ROOT6 work-arounds for testing.

>>> os.environ['ROOT6_WORK_AROUND'] = 'all'
>>> ROOT6WorkAroundEnabled()
True
>>> os.environ['ROOT6_WORK_AROUND'] = 'none'
>>> ROOT6WorkAroundEnabled('JIRA-XYZ')
False
>>> os.environ['ROOT6_WORK_AROUND'] = 'JIRA-X'
>>> ROOT6WorkAroundEnabled('JIRA-X')
True
>>> ROOT6WorkAroundEnabled('JIRA-Y')
True
>>> os.environ['ROOT6_WORK_AROUND'] = 'JIRA-X,-JIRA-Y'
>>> ROOT6WorkAroundEnabled('JIRA-X')
True
>>> ROOT6WorkAroundEnabled('JIRA-Y')
False
>>> os.environ['ROOT6_WORK_AROUND'] = '-JIRA-Y'
>>> ROOT6WorkAroundEnabled('JIRA-X')
True
>>> ROOT6WorkAroundEnabled('JIRA-Y')
False

Definition at line 4 of file __init__.py.

4 def ROOT6WorkAroundEnabled(id=None):
5  '''
6  Helper function to easily exclude ROOT6 work-arounds for testing.
7 
8  >>> os.environ['ROOT6_WORK_AROUND'] = 'all'
9  >>> ROOT6WorkAroundEnabled()
10  True
11  >>> os.environ['ROOT6_WORK_AROUND'] = 'none'
12  >>> ROOT6WorkAroundEnabled('JIRA-XYZ')
13  False
14  >>> os.environ['ROOT6_WORK_AROUND'] = 'JIRA-X'
15  >>> ROOT6WorkAroundEnabled('JIRA-X')
16  True
17  >>> ROOT6WorkAroundEnabled('JIRA-Y')
18  True
19  >>> os.environ['ROOT6_WORK_AROUND'] = 'JIRA-X,-JIRA-Y'
20  >>> ROOT6WorkAroundEnabled('JIRA-X')
21  True
22  >>> ROOT6WorkAroundEnabled('JIRA-Y')
23  False
24  >>> os.environ['ROOT6_WORK_AROUND'] = '-JIRA-Y'
25  >>> ROOT6WorkAroundEnabled('JIRA-X')
26  True
27  >>> ROOT6WorkAroundEnabled('JIRA-Y')
28  False
29  '''
30  enabled = os.environ.get('ROOT6_WORK_AROUND', 'all').lower()
31  if enabled == 'all':
32  return True
33  if enabled in ('none', 'no', 'off', 'false', '0'):
34  return False
35  if id is None: # unnamed work-arounds can only be disabled globally
36  return True
37  enabled = set(map(str.strip, enabled.split(',')))
38  disabled = set([e[1:] for e in enabled if e.startswith('-')])
39  id = id.lower()
40  # the w-a is enabled if in the enabled list or not explicitly disabled
41  return id in enabled or id not in disabled
42 
def ROOT6WorkAroundEnabled(id=None)
Definition: __init__.py:4
struct GAUDI_API map
Parametrisation class for map-like implementation.