Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v30r3 (a5ef0a68)
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 141 of file Main.py.

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

Variable Documentation

Gaudi.Main._bootstrap = None
private

Definition at line 138 of file Main.py.

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

Definition at line 7 of file Main.py.