00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "GaudiKernel/SmartIF.h"
00012 #include "GaudiKernel/Bootstrap.h"
00013 #include "GaudiKernel/IAppMgrUI.h"
00014 #include "GaudiKernel/IProperty.h"
00015 #include "GaudiKernel/StatusCode.h"
00016 #include <iostream>
00017
00018
00019 int main ( int argc, char** argv ) {
00020
00021 IInterface* iface = Gaudi::createApplicationMgr();
00022 SmartIF<IProperty> propMgr ( iface );
00023 SmartIF<IAppMgrUI> appMgr ( iface );
00024
00025 if( !appMgr.isValid() || !propMgr.isValid() ) {
00026 std::cout << "Fatal error while creating the ApplicationMgr " << std::endl;
00027 return 1;
00028 }
00029
00030
00031 std:: string opts = (argc>1) ? argv[1] : "";
00032
00033 propMgr->setProperty( "JobOptionsPath", opts );
00034
00035
00036 #if defined APPNAME
00037 propMgr->setProperty( "AppName", APPNAME );
00038 #endif
00039 #if defined APPVERS
00040 propMgr->setProperty( "AppVersion", APPVERS );
00041 #endif
00042
00043 if( opts != "" && opts.substr( opts.length() - 3, 3 ) == ".py" ) {
00044 propMgr->setProperty( "EvtSel", "NONE" );
00045 propMgr->setProperty( "JobOptionsType", "NONE" );
00046 propMgr->setProperty( "DLLs", "['GaudiPython']" );
00047 propMgr->setProperty( "Runable", "PythonScriptingSvc" );
00048 }
00049
00050
00051 StatusCode sc=appMgr->run();
00052
00053
00054 iface->release();
00055
00056
00057 return (sc==StatusCode::SUCCESS)?0:1;
00058 }