#include </builds/gaudi/Gaudi/GaudiCoreSvc/src/JobOptionsSvc/PythonConfig.h>
Definition at line 33 of file PythonConfig.h.
◆ PythonConfig()
◆ evaluateConfig()
Definition at line 20 of file PythonConfig.cpp.
25 object main_module( ( handle<>( borrowed( PyImport_AddModule(
"__main__" ) ) ) ) );
26 object main_namespace = main_module.attr(
"__dict__" );
29 main_namespace[
"PythonAdaptor"] =
30 class_<PythonAdaptor>(
"PythonAdaptor", boost::python::init<Gaudi::Interfaces::IOptionsSvc*>() )
35 main_namespace[
"adaptor"] = ptr( &adaptor );
41 command +=
" with open(name) as f:\n";
42 command +=
" code = compile(f.read(), name, 'exec')\n";
44 command +=
"from GaudiKernel.Configurable import expandvars\nfrom GaudiKernel.Proxy.Configurable import "
45 "applyConfigurableUsers\napplyConfigurableUsers()\n";
47 command +=
"\nfor n, c in Configurable.allConfigurables.items():\n for p, v in c.getValuedProperties().items() "
48 ":\n v = expandvars(v)\n if type(v) == str : v = repr(v) # need double quotes\n elif "
49 "type(v) == long: v = '%d' % v # prevent pending 'L'\n adaptor.addPropertyToJobOptions(n,p,str(v))";
52 handle<> ignored( ( PyRun_String(
command.c_str(), Py_file_input, main_namespace.ptr(), main_namespace.ptr() ) ) );
53 }
catch (
const error_already_set& ) {
◆ m_optsSvc
The documentation for this class was generated from the following files: