Commit 1a55790f authored by Minh Ngo's avatar Minh Ngo
Browse files

Removing the asynchronous python3 server call.

BUG: 373150
parent f10359f8
......@@ -27,6 +27,14 @@ Python3Server::Python3Server(QObject* parent)
{
}
namespace
{
QString pyObjectToQString(PyObject* obj)
{
return QString::fromUtf8(PyUnicode_AsUTF8(obj));
}
}
void Python3Server::login()
{
Py_Initialize();
......@@ -54,9 +62,6 @@ QString Python3Server::getOutput() const
return pyObjectToQString(output);
}
QString Python3Server::pyObjectToQString(PyObject* obj) const
{
return QString::fromUtf8(PyUnicode_AsUTF8(obj));
}
#include "python3server.moc"
......@@ -38,9 +38,6 @@ class Python3Server : public QObject
Q_SCRIPTABLE QString getOutput() const;
Q_SCRIPTABLE QString getError() const;
private:
QString pyObjectToQString(PyObject* obj) const;
private:
PyObject* m_pModule;
};
......
......@@ -101,22 +101,10 @@ void Python3Session::runPythonCommand(const QString& command) const
m_pIface->call(QString::fromLatin1("runPythonCommand"), command);
}
void Python3Session::runPythonCommandAsync(const QString& command)
{
m_pIface->callWithCallback(QString::fromLatin1("runPythonCommand"), {command},
(Python3Session*)this,
SLOT(onResultReady()));
}
void Python3Session::readExpressionOutput(const QString& commandProcessing)
{
runClassOutputPython();
runPythonCommandAsync(commandProcessing);
changeStatus(Cantor::Session::Running);
}
void Python3Session::onResultReady()
{
runPythonCommand(commandProcessing);
m_output = getOutput();
m_error = getError();
......
......@@ -40,15 +40,11 @@ class Python3Session : public PythonSession
private:
void runPythonCommand(const QString& command) const;
void runPythonCommandAsync(const QString& command);
void readExpressionOutput(const QString& commandProcessing);
QString getOutput() const;
QString getError() const;
private Q_SLOTS:
void onResultReady();
private:
QDBusInterface* m_pIface;
KProcess* m_pProcess;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment