Gaudi Framework, version v25r2

Home   Generated: Wed Jun 4 2014
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Namespaces | Functions
GaudiKernel Namespace Reference

Namespaces

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

Functions

def ROOT6WorkAroundEnabled
 

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 3 of file __init__.py.

3 
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

Generated at Wed Jun 4 2014 14:49:05 for Gaudi Framework, version v25r2 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004