Unable to compile with both python event-scripts and python plugins
Posted: Sunday 15 January 2017 11:37
Hello,
Using latest master-branch from github, I'm not able to compile with support for BOTH the new python plugins and using python event-scripts.
Using a cmake-configuration with python3.4 it's no problem compiling with support for plugins, and using a cmake-configuration with python2.7, no problem compiling with support for python event-scripts. I believe the problem stems from the changed python-API between major version 2 and 3.
I've taken a look at the EventSystem.cpp, but my CPP-mojo is far from adequate for trying to update the code to use python3.
I guests I could port my pyton-scripts to LUA, but since the introduction of python-plugins, python feels like the way to go, and my scripts depend on some python modules.
Using latest master-branch from github, I'm not able to compile with support for BOTH the new python plugins and using python event-scripts.
Using a cmake-configuration with python3.4 it's no problem compiling with support for plugins, and using a cmake-configuration with python2.7, no problem compiling with support for python event-scripts. I believe the problem stems from the changed python-API between major version 2 and 3.
the python code in EventSystem.cpp appears to be using the old 2.7-api, and thus unable to compile using python3, required for plugins.../home/mak/domoticz/domoticz-py3/main/EventSystem.cpp:2233:45: error: ‘Py_InitModule’ was not declared in this scope
Py_InitModule("domoticz_", DomoticzMethods);
I've taken a look at the EventSystem.cpp, but my CPP-mojo is far from adequate for trying to update the code to use python3.
I guests I could port my pyton-scripts to LUA, but since the introduction of python-plugins, python feels like the way to go, and my scripts depend on some python modules.