Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Education
Cantor
Commits
1a55790f
Commit
1a55790f
authored
Mar 12, 2017
by
Minh Ngo
Browse files
Removing the asynchronous python3 server call.
BUG: 373150
parent
f10359f8
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/backends/python3/python3server/python3server.cpp
View file @
1a55790f
...
...
@@ -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"
src/backends/python3/python3server/python3server.h
View file @
1a55790f
...
...
@@ -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
;
};
...
...
src/backends/python3/python3session.cpp
View file @
1a55790f
...
...
@@ -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
();
...
...
src/backends/python3/python3session.h
View file @
1a55790f
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment