27 declareProperty(
"StartupScript", m_startupScript =
"" );
50 tmp.
assign(prpMgr->getProperty(
"JobOptionsType"));
51 if ( tmp.
value( ) ==
"NONE" ) {
52 tmp.
assign(prpMgr->getProperty(
"JobOptionsPath"));
58 char* progName[] = {
const_cast<char*
>(
"GaudiPython") };
63 PySys_SetArgv( 1, progName );
67 std::string vers(version, 0, version.find_first_of(
'.',version.find_first_of(
'.')+1));
68 info() <<
"Python version: [" << vers <<
"]" <<
endmsg;
75 dlopen(libname.
c_str(), RTLD_GLOBAL | RTLD_LAZY);
80 PyRun_SimpleString(
"from gaudimodule import *" );
81 PyRun_SimpleString(
"g = AppMgr()" );
83 PyRun_SimpleString(
"theApp = g" );
84 PyRun_SimpleString(
"def Service(n): return g.service(n)" );
85 PyRun_SimpleString(
"def Algorithm(n): return g.algorithm(n)" );
86 PyRun_SimpleString(
"def Property(n): return g.service(n)" );
88 #if !defined( _WIN32 )
89 PyRun_SimpleString(
"import rlcompleter");
90 PyRun_SimpleString(
"rlcompleter.readline.parse_and_bind('tab: complete')");
119 file.seekg(0, std::ios::beg);
123 PyRun_SimpleString( buffer.
c_str() );
128 PyRun_InteractiveLoop(stdin,
"\0");
StatusCode initialize() override
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
StatusCode finalize() override
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
virtual StatusCode finalize()
Finalize the service. [IService::finalize()].
bool isFailure() const
Test for a status code of FAILURE.
#define DECLARE_COMPONENT(type)
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
This class is used for returning status codes from appropriate routines.
std::string m_startupScript
Startup script.
T find_first_of(T...args)
auto end(reverse_wrapper< T > &w)
This service handles scripting implemented using Python.
virtual ~PythonScriptingSvc()
Destructor.
const TYPE & value() const
explicit conversion
bool assign(const Property &source) override
get the value from another property
virtual StatusCode run()
Run the service by taking full control. [IRunable::run()].
The IProperty is the basic interface for all components which have properties that can be set or get...
virtual StatusCode initialize()
Initialize the service. [IService::initialize()].
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.