4 #include "GaudiKernel/MsgStream.h"
5 #include "GaudiKernel/ISvcLocator.h"
6 #include "GaudiKernel/SmartIF.h"
27 declareProperty(
"StartupScript", m_startupScript =
"" );
51 tmp.
assign(prpMgr->getProperty(
"JobOptionsType"));
52 if ( tmp.
value( ) ==
"NONE" ) {
53 tmp.
assign(prpMgr->getProperty(
"JobOptionsPath"));
59 char* progName[] = {
const_cast<char*
>(
"GaudiPython") };
64 PySys_SetArgv( 1, progName );
66 std::string fullversion = Py_GetVersion();
67 std::string version( fullversion, 0, fullversion.find_first_of(
' '));
68 std::string vers(version, 0, version.find_first_of(
'.',version.find_first_of(
'.')+1));
75 std::string libname =
"libpython" + vers +
".so";
76 dlopen(libname.c_str(), RTLD_GLOBAL | RTLD_LAZY);
81 PyRun_SimpleString(
"from gaudimodule import *" );
82 PyRun_SimpleString(
"g = AppMgr()" );
84 PyRun_SimpleString(
"theApp = g" );
85 PyRun_SimpleString(
"def Service(n): return g.service(n)" );
86 PyRun_SimpleString(
"def Algorithm(n): return g.algorithm(n)" );
87 PyRun_SimpleString(
"def Property(n): return g.service(n)" );
89 #if !defined( _WIN32 )
90 PyRun_SimpleString(
"import rlcompleter");
91 PyRun_SimpleString(
"rlcompleter.readline.parse_and_bind('tab: complete')");
118 std::stringstream stream;
121 while(
file.get(ch) ) stream.put(ch);
122 PyRun_SimpleString( const_cast<char*>(stream.str().c_str()) );
129 PyRun_InteractiveLoop(stdin,
"\0");