//============================================================================= // METHOD : SPELLdriverManager::setup //============================================================================= void SPELLdriverManager::setup( std::string ctxName ) { SPELLsafePythonOperations ops; PyObject* pmgr = getDriverManagerObject(); SPELLpythonHelper::instance().callMethod( pmgr, "setup", SSTRPY(ctxName), NULL); SPELLpythonHelper::instance().checkError(); }
//============================================================================= // METHOD : SPELLdriverManager::setup //============================================================================= void SPELLdriverManager::setup( const std::string& ctxName, const std::string& interfaces ) { SPELLsafePythonOperations ops("SPELLdriverManager::setup()"); PyObject* pmgr = getDriverManagerObject(); if (interfaces.empty()) { SPELLpythonHelper::instance().callMethod( pmgr, "setup", SSTRPY(ctxName), NULL); } else { SPELLpythonHelper::instance().callMethod( pmgr, "setup", SSTRPY(ctxName), SSTRPY(interfaces), NULL); } SPELLpythonHelper::instance().checkError(); }
//============================================================================= // METHOD : SPELLdriverManager::cleanup //============================================================================= void SPELLdriverManager::cleanup( bool shutdown ) { SPELLsafePythonOperations ops("SPELLdriverManager::cleanup()"); PyObject* pmgr = getDriverManagerObject(); if (shutdown) { SPELLpythonHelper::instance().callMethod( pmgr, "cleanup", Py_False, Py_True, NULL ); } else { SPELLpythonHelper::instance().callMethod( pmgr, "cleanup", NULL); } SPELLpythonHelper::instance().checkError(); }
//============================================================================= // METHOD : SPELLdriverManager::onCommand //============================================================================= void SPELLdriverManager::onCommand( const std::string& commandId ) { PyObject* pmgr = getDriverManagerObject(); PyObject* cmd = SSTRPY(commandId); Py_INCREF(cmd); try { SPELLpythonHelper::instance().callMethod( pmgr, "onCommand", cmd, NULL ); SPELLpythonHelper::instance().checkError(); } catch(SPELLcoreException& ex) { LOG_ERROR("OnCommand failed: " + ex.what()); } }