The Gaudi Framework  v32r2 (46d42edc)
Gaudi.Main Namespace Reference

Classes

class  BootstrapHelper
 
class  gaudimain
 

Functions

def toOpt (value)
 

Variables

 log = logging.getLogger(__name__)
 
 _bootstrap = None
 

Function Documentation

◆ toOpt()

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 162 of file Main.py.

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

Variable Documentation

◆ _bootstrap

Gaudi.Main._bootstrap = None
private

Definition at line 159 of file Main.py.

◆ log

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

Definition at line 10 of file Main.py.