Loading [MathJax]/extensions/tex2jax.js
Go to the documentation of this file.
14 #if PY_MAJOR_VERSION >= 3
16 # define PySys_SetArgv_Char_t wchar_t
20 # define PySys_SetArgv_Char_t char
35 #if defined( __linux )
48 declareProperty(
"StartupScript", m_startupScript =
"" );
70 tmp.
assign( prpMgr->getProperty(
"JobOptionsType" ) );
71 if ( tmp.
value() ==
"NONE" ) {
72 tmp.
assign( prpMgr->getProperty(
"JobOptionsPath" ) );
79 #if PY_MAJOR_VERSION >= 3
80 wchar_t* progName[] = {
const_cast<wchar_t*
>(
L"GaudiPython" ) };
82 char* progName[] = {
const_cast<char*
>(
"GaudiPython" ) };
88 PySys_SetArgv( 1, progName );
93 info() <<
"Python version: [" << vers <<
"]" <<
endmsg;
95 #if defined( __linux )
100 dlopen( libname.
c_str(), RTLD_GLOBAL | RTLD_LAZY );
104 PyRun_SimpleString(
"from gaudimodule import *" );
105 PyRun_SimpleString(
"g = AppMgr()" );
107 PyRun_SimpleString(
"theApp = g" );
108 PyRun_SimpleString(
"def Service(n): return g.service(n)" );
109 PyRun_SimpleString(
"def Algorithm(n): return g.algorithm(n)" );
110 PyRun_SimpleString(
"def Property(n): return g.service(n)" );
112 #if !defined( _WIN32 )
113 PyRun_SimpleString(
"import rlcompleter" );
114 PyRun_SimpleString(
"rlcompleter.readline.parse_and_bind('tab: complete')" );
142 buffer.
reserve( file.tellg() );
143 file.seekg( 0, std::ios::beg );
146 PyRun_SimpleString( buffer.
c_str() );
151 PyRun_InteractiveLoop( stdin,
"\0" );
std::string m_startupScript
Startup script.
StatusCode initialize() override
bool assign(const Details::PropertyBase &source) override
get the value from another property
StatusCode finalize() override
const ValueType & value() const
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
~PythonScriptingSvc() override
Destructor.
StatusCode run() override
Run the service by taking full control. [IRunable::run()].
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
constexpr static const auto SUCCESS
StatusCode initialize() override
Initialize the service. [IService::initialize()].
#define DECLARE_COMPONENT(type)
StatusCode finalize() override
Finalize the service. [IService::finalize()].
T find_first_of(T... args)
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator