14 #if defined( __linux ) 49 tmp.
assign( prpMgr->getProperty(
"JobOptionsType" ) );
50 if ( tmp.
value() ==
"NONE" ) {
51 tmp.
assign( prpMgr->getProperty(
"JobOptionsPath" ) );
57 char* progName[] = {
const_cast<char*
>(
"GaudiPython" )};
62 PySys_SetArgv( 1, progName );
66 std::string vers( version, 0, version.find_first_of(
'.', version.find_first_of(
'.' ) + 1 ) );
67 info() <<
"Python version: [" << vers <<
"]" <<
endmsg;
69 #if defined( __linux ) 74 dlopen( libname.
c_str(), RTLD_GLOBAL | RTLD_LAZY );
78 PyRun_SimpleString(
"from gaudimodule import *" );
79 PyRun_SimpleString(
"g = AppMgr()" );
81 PyRun_SimpleString(
"theApp = g" );
82 PyRun_SimpleString(
"def Service(n): return g.service(n)" );
83 PyRun_SimpleString(
"def Algorithm(n): return g.algorithm(n)" );
84 PyRun_SimpleString(
"def Property(n): return g.service(n)" );
86 #if !defined( _WIN32 ) 87 PyRun_SimpleString(
"import rlcompleter" );
88 PyRun_SimpleString(
"rlcompleter.readline.parse_and_bind('tab: complete')" );
116 buffer.
reserve( file.tellg() );
117 file.seekg( 0, std::ios::beg );
120 PyRun_SimpleString( buffer.
c_str() );
125 PyRun_InteractiveLoop( stdin,
"\0" );
StatusCode initialize() override
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
~PythonScriptingSvc() override
Destructor.
StatusCode finalize() override
Implementation of property with value of concrete type.
StatusCode run() override
Run the service by taking full control. [IRunable::run()].
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
constexpr static const auto SUCCESS
StatusCode finalize() override
Finalize the service. [IService::finalize()].
#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.
Gaudi::Details::PropertyBase * declareProperty(const std::string &name, TYPE &value, const std::string &doc="none")
Declare a property (templated)
std::string m_startupScript
Startup script.
T find_first_of(T...args)
This service handles scripting implemented using Python.
StatusCode initialize() override
Initialize the service. [IService::initialize()].
bool assign(const Details::PropertyBase &source) override
get the value from another property
const ValueType & value() const
Backward compatibility (.
The IProperty is the basic interface for all components which have properties that can be set or get...
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.