Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v29r0 (ff2e7097)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 140 of file Main.py.

140 def toOpt(value):
141  '''
142  Helper to convert values to old .opts format.
143 
144  >>> print toOpt('some "text"')
145  "some \\"text\\""
146  >>> print toOpt('first\\nsecond')
147  "first
148  second"
149  >>> print toOpt({'a': [1, 2, '3']})
150  {"a": [1, 2, "3"]}
151  '''
152  if isinstance(value, basestring):
153  return '"{0}"'.format(value.replace('"', '\\"'))
154  elif isinstance(value, dict):
155  return '{{{0}}}'.format(', '.join('{0}: {1}'.format(toOpt(k), toOpt(v))
156  for k, v in value.iteritems()))
157  elif hasattr(value, '__iter__'):
158  return '[{0}]'.format(', '.join(map(toOpt, value)))
159  else:
160  return repr(value)
161 
162 
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:120
def toOpt(value)
Definition: Main.py:140
struct GAUDI_API map
Parametrisation class for map-like implementation.

Variable Documentation

Gaudi.Main._bootstrap = None
private

Definition at line 137 of file Main.py.

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

Definition at line 7 of file Main.py.