36 #pragma GCC diagnostic push
37 #pragma GCC diagnostic ignored "-Wshadow"
38 #include "pybind11/embed.h"
39 #include "pybind11/eval.h"
40 #include "pybind11/functional.h"
41 #include "pybind11/operators.h"
42 #include "pybind11/stl.h"
43 #include "pybind11/stl_bind.h"
44 #pragma GCC diagnostic pop
48 class PythonContextSubscriber;
81 namespace py = pybind11;
118 void interpretBackground(
QObject* caller,
const QString&
input,
bool multiple_expressions =
false);
146 void scheduleClear();
151 void scheduleReset();
170 std::vector<std::tuple<std::string, std::string>> complete(
const QString& text,
bool use_console_context);
177 int checkCompleteStatement(
const QString& text);
196 void updateNetlist();
200 static void initializeContext(py::dict* context);
201 static void initializeScript(py::dict* context);
204 void abortThreadAndWait();
208 void handleThreadFinished();
209 void handleScriptOutput(
const QString& txt);
210 void handleScriptError(
const QString& txt);
212 void handleConsoleInputReceived(
const QString& input);
225 std::string mHistoryFile;
233 PyThreadState* mMainThreadState;
236 void startThread(
const QString& input,
bool singleStatement);
An interactable python console.
bool isThreadRunning() const
Interface for handling python outputs.
PythonGateSelectionReceiver(PythonThread *thread, QObject *parent=nullptr)
void handleGatesPicked(const QSet< u32 > &gats) override
PythonModuleSelectionReceiver(PythonThread *thread, QObject *parent=nullptr)
void handleModulesPicked(const QSet< u32 > &gats) override
QObject * parent() const const
QThread * thread() const const