Refactor Python

This commit is contained in:
Lord-Grey
2024-11-14 23:00:10 +01:00
parent 1dfbdb7f6f
commit 60f5a07500
8 changed files with 565 additions and 412 deletions

View File

@@ -1,5 +1,9 @@
#pragma once
#undef slots
#include <Python.h>
#define slots Q_SLOTS
///
/// @brief Handle the PythonInit, module registers and DeInit
///
@@ -10,4 +14,6 @@ private:
PythonInit();
~PythonInit();
void handlePythonError(PyStatus status, PyConfig& config);
};

View File

@@ -9,6 +9,8 @@
#include "Python.h"
#define slots
#include <python/PythonUtils.h>
class Logger;
class PythonProgram
@@ -17,9 +19,15 @@ public:
PythonProgram(const QString & name, Logger * log);
~PythonProgram();
operator PyThreadState* ()
{
return _tstate;
}
void execute(const QByteArray &python_code);
private:
QString _name;
Logger* _log;
PyThreadState* _tstate;