The Gaudi Framework  v31r0 (aeb156f0)
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 154 of file Main.py.

154 def toOpt(value):
155  '''
156  Helper to convert values to old .opts format.
157 
158  >>> print toOpt('some "text"')
159  "some \\"text\\""
160  >>> print toOpt('first\\nsecond')
161  "first
162  second"
163  >>> print toOpt({'a': [1, 2, '3']})
164  {"a": [1, 2, "3"]}
165  '''
166  if isinstance(value, basestring):
167  return '"{0}"'.format(value.replace('"', '\\"'))
168  elif isinstance(value, dict):
169  return '{{{0}}}'.format(', '.join(
170  '{0}: {1}'.format(toOpt(k), toOpt(v))
171  for k, v in value.iteritems()))
172  elif hasattr(value, '__iter__'):
173  return '[{0}]'.format(', '.join(map(toOpt, value)))
174  else:
175  return repr(value)
176 
177 
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:109
def toOpt(value)
Definition: Main.py:154
struct GAUDI_API map
Parametrisation class for map-like implementation.

Variable Documentation

Gaudi.Main._bootstrap = None
private

Definition at line 151 of file Main.py.

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

Definition at line 7 of file Main.py.