mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Refactor Python
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user