51 const char* acn,
int* argc,
char** argv,
Bool_t ) :
81 Gl_histinit( (
char*)
"-" );
95 PyObject* argl = PySys_GetObject( const_cast< char* >(
"argv" ) );
98 if ( argl && 0 < PyList_Size( argl ) ) argc = (int)PyList_GET_SIZE( argl );
99 char** argv =
new char*[ argc ];
100 for (
int i = 1; i < argc; ++i ) {
102 if ( strcmp( argi,
"-" ) == 0 || strcmp( argi,
"--" ) == 0 ) {
109 #if PY_VERSION_HEX < 0x03000000 110 if ( Py_GetProgramName() && strlen( Py_GetProgramName() ) != 0 )
111 argv[ 0 ] = Py_GetProgramName();
113 argv[ 0 ] = (
char*)
"python";
116 argv[ 0 ] = (
char*)
"python";
138 #if PY_VERSION_HEX < 0x03000000 ErrorHandlerFunc_t SetErrorHandler(ErrorHandlerFunc_t newhandler)
Set an errorhandler function. Returns the old handler.
virtual Long_t ProcessLine(const char *line, Bool_t sync=kFALSE, Int_t *error=0)
Process a single command line, either a C++ statement or an interpreter command starting with a "...
R__EXTERN TStyle * gStyle
R__EXTERN TApplication * gApplication
#define PyROOT_PyUnicode_AsString
static Bool_t InitROOTGlobals()
Setup the basic ROOT globals gBenchmark, gStyle, gProgname, if not already set.
TStyle objects may be created to define special styles.
void ErrMsgHandler(int level, Bool_t abort, const char *location, const char *msg)
Translate ROOT error/warning to python.
R__EXTERN const char * gProgName
R__EXTERN TSystem * gSystem
R__EXTERN TBenchmark * gBenchmark
static Bool_t InitROOTMessageCallback()
Install ROOT message handler which will turn ROOT error message into python exceptions.
This class is a ROOT utility to help benchmarking applications.
TPyROOTApplication(const char *acn, Int_t *argc, char **argv, Bool_t bLoadLibs=kTRUE)
virtual void SetProgname(const char *name)
Set the application name (from command line, argv[0]) and copy it in gProgName.
void(* ErrorHandlerFunc_t)(int level, Bool_t abort, const char *location, const char *msg)
static Bool_t CreatePyROOTApplication(Bool_t bLoadLibs=kTRUE)
This class creates the ROOT Application Environment that interfaces to the windowing system eventloop...
void SetReturnFromRun(Bool_t ret)