Add support for Python 3

Former-commit-id: b6aec954ba0e79ba5697ea8cc305eb9f7d29f332
This commit is contained in:
Johan
2014-02-26 18:10:17 +01:00
parent 1a92e6ccd2
commit e0d405034f
8 changed files with 101 additions and 37 deletions

View File

@@ -54,6 +54,7 @@ EffectEngine::EffectEngine(Hyperion * hyperion, const Json::Value & jsonEffectCo
// initialize the python interpreter
std::cout << "Initializing Python interpreter" << std::endl;
Effect::registerHyperionExtensionModule();
Py_InitializeEx(0);
PyEval_InitThreads(); // Create the GIL
_mainThreadState = PyEval_SaveThread();
@@ -151,7 +152,7 @@ int EffectEngine::runEffectScript(const std::string &script, const Json::Value &
channelCleared(priority);
// create the effect
Effect * effect = new Effect(priority, timeout, script, args);
Effect * effect = new Effect(_mainThreadState, priority, timeout, script, args);
connect(effect, SIGNAL(setColors(int,std::vector<ColorRgb>,int,bool)), _hyperion, SLOT(setColors(int,std::vector<ColorRgb>,int,bool)), Qt::QueuedConnection);
connect(effect, SIGNAL(effectFinished(Effect*)), this, SLOT(effectFinished(Effect*)));
_activeEffects.push_back(effect);