14 #if defined( __linux ) 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;
70 #if defined( __linux ) 75 dlopen( libname.
c_str(), RTLD_GLOBAL | RTLD_LAZY );
79 PyRun_SimpleString(
"from gaudimodule import *" );
80 PyRun_SimpleString(
"g = AppMgr()" );
82 PyRun_SimpleString(
"theApp = g" );
83 PyRun_SimpleString(
"def Service(n): return g.service(n)" );
84 PyRun_SimpleString(
"def Algorithm(n): return g.algorithm(n)" );
85 PyRun_SimpleString(
"def Property(n): return g.service(n)" );
87 #if !defined( _WIN32 ) 88 PyRun_SimpleString(
"import rlcompleter" );
89 PyRun_SimpleString(
"rlcompleter.readline.parse_and_bind('tab: complete')" );
117 buffer.
reserve( file.tellg() );
118 file.seekg( 0, std::ios::beg );
121 PyRun_SimpleString( buffer.
c_str() );
126 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)
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.
constexpr static const auto SUCCESS
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.