Gaudi.Main Namespace Reference

Classes

class  BootstrapHelper
 
class  gaudimain
 

Functions

def toOpt (value)
 

Variables

 log = logging.getLogger(__name__)
 
 _bootstrap = None
 

Function Documentation

def Gaudi.Main.toOpt (   value)
Helper to convert values to old .opts format.

>>> print toOpt('some "text"')
"some \\"text\\""
>>> print toOpt('first\\nsecond')
"first
second"
>>> print toOpt({'a': [1, 2, '3']})
{"a": [1, 2, "3"]}

Definition at line 117 of file Main.py.

117 def toOpt(value):
118  '''
119  Helper to convert values to old .opts format.
120 
121  >>> print toOpt('some "text"')
122  "some \\"text\\""
123  >>> print toOpt('first\\nsecond')
124  "first
125  second"
126  >>> print toOpt({'a': [1, 2, '3']})
127  {"a": [1, 2, "3"]}
128  '''
129  if isinstance(value, basestring):
130  return '"{0}"'.format(value.replace('"', '\\"'))
131  elif isinstance(value, dict):
132  return '{{{0}}}'.format(', '.join('{0}: {1}'.format(toOpt(k), toOpt(v))
133  for k, v in value.iteritems()))
134  elif hasattr(value, '__iter__'):
135  return '[{0}]'.format(', '.join(map(toOpt, value)))
136  else:
137  return repr(value)
138 
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
def toOpt(value)
Definition: Main.py:117
struct GAUDI_API map
Parametrisation class for map-like implementation.

Variable Documentation

Gaudi.Main._bootstrap = None
private

Definition at line 115 of file Main.py.

Gaudi.Main.log = logging.getLogger(__name__)

Definition at line 6 of file Main.py.