| The Gaudi Framework v30r0 (c919700c)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Namespace List
- Namespace Members

Classes | Functions | Variables
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
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:120
Gaudi.Main.toOpt
def toOpt(value)
Definition: Main.py:140
Containers::map
struct GAUDI_API map
Parametrisation class for map-like implementation.
Definition: KeyedObjectManager.h:26

## 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.