[apps/code] Fix variables loading in the console

The two following scenari display empty variable boxes, when there
should be loaded variables.
1) Open the console, go back to the scripts menu, go back to the
console, open the variable box
2) Open the console, execute mandelbrot, open the variable box
This commit is contained in:
Léa Saviot
2020-06-25 11:31:01 +02:00
parent ef210f9cff
commit 2d1d3ca944

View File

@@ -48,6 +48,7 @@ ConsoleController::ConsoleController(Responder * parentResponder, App * pythonDe
bool ConsoleController::loadPythonEnvironment() {
if (!m_pythonDelegate->isPythonUser(this)) {
m_scriptStore->clearConsoleFetchInformation();
emptyOutputAccumulationBuffer();
m_pythonDelegate->initPythonWithUser(this);
MicroPython::registerScriptProvider(m_scriptStore);
@@ -173,7 +174,6 @@ const char * ConsoleController::inputText(const char * prompt) {
void ConsoleController::viewWillAppear() {
ViewController::viewWillAppear();
m_scriptStore->clearConsoleFetchInformation();
loadPythonEnvironment();
if (m_importScriptsWhenViewAppears) {
m_importScriptsWhenViewAppears = false;