Make it build with 0.23

pull/341/head
Michael Zanetti 2020-08-29 15:47:16 +02:00
parent fdbdb02c16
commit d4889b5b78
4 changed files with 7 additions and 6 deletions

View File

@ -3,10 +3,11 @@
#include <Python.h>
#include "loggingcategories.h"
#include <QLoggingCategory>
#include <QVariant>
Q_DECLARE_LOGGING_CATEGORY(dcPythonIntegrations)
/* Returns a new reference to PyObject*. */
PyObject *QVariantToPyObject(const QVariant &value)
{
@ -76,7 +77,7 @@ PyObject* pyLog_write(PyObject* /*self*/, PyObject* args)
if (!PyArg_ParseTuple(args, "s", &what))
return nullptr;
if (!QByteArray(what).trimmed().isEmpty()) {
qCDebug(dcThingManager()) << what;
qCDebug(dcPythonIntegrations()) << what;
}
Py_RETURN_NONE;
}
@ -111,7 +112,7 @@ PyObject* pyWarn_write(PyObject* /*self*/, PyObject* args)
if (!PyArg_ParseTuple(args, "s", &what))
return nullptr;
if (!QByteArray(what).trimmed().isEmpty()) {
qCWarning(dcThingManager()) << what;
qCWarning(dcPythonIntegrations()) << what;
}
Py_RETURN_NONE;
}

View File

@ -14,6 +14,8 @@
#include <QFuture>
#include <QFutureWatcher>
NYMEA_LOGGING_CATEGORY(dcPythonIntegrations, "PythonIntegrations")
PyThreadState* PythonIntegrationPlugin::s_mainThreadState = nullptr;
QHash<PythonIntegrationPlugin*, PyObject*> PythonIntegrationPlugin::s_plugins;

View File

@ -75,7 +75,6 @@ NYMEA_LOGGING_CATEGORY(dcBluetoothServerTraffic, "BluetoothServerTraffic")
NYMEA_LOGGING_CATEGORY(dcMqtt, "Mqtt")
NYMEA_LOGGING_CATEGORY(dcTranslations, "Translations")
NYMEA_LOGGING_CATEGORY(dcI2C, "I2C")
NYMEA_LOGGING_CATEGORY(dcPythonIntegrations, "PythonIntegrations")
static QFile s_logFile;

View File

@ -91,7 +91,6 @@ Q_DECLARE_LOGGING_CATEGORY(dcCoap)
Q_DECLARE_LOGGING_CATEGORY(dcI2C)
Q_DECLARE_LOGGING_CATEGORY(dcIntegrations)
Q_DECLARE_LOGGING_CATEGORY(dcJsIntegrations)
Q_DECLARE_LOGGING_CATEGORY(dcPythonIntegrations)
/*