From 5f8160259d716a973ebb539c37bdb4a9b6cc62ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Tue, 10 Oct 2023 09:35:36 -0300 Subject: [PATCH] Cleaned up code. --- mrv2/lib/mrvPanels/mrvPythonPanel.cpp | 3 --- mrv2/lib/mrvPy/FLTKRedirectOutput.cpp | 4 ++-- mrv2/lib/mrvWidgets/mrvPythonEditor.cpp | 1 - 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/mrv2/lib/mrvPanels/mrvPythonPanel.cpp b/mrv2/lib/mrvPanels/mrvPythonPanel.cpp index a16ee4559..5ed54abe1 100644 --- a/mrv2/lib/mrvPanels/mrvPythonPanel.cpp +++ b/mrv2/lib/mrvPanels/mrvPythonPanel.cpp @@ -418,12 +418,10 @@ from mrv2 import playlist, timeline, usd, settings outputDisplay->warning(code.c_str()); if (!eval.empty() && var != eval) { - eval += '\n'; outputDisplay->warning(eval.c_str()); } try { - PyStdErrOutStreamRedirect pyRedirect; py::exec(code); if (!eval.empty()) { @@ -434,7 +432,6 @@ from mrv2 import playlist, timeline, usd, settings catch (const std::exception& e) { outputDisplay->error(e.what()); - outputDisplay->error("\n"); } } diff --git a/mrv2/lib/mrvPy/FLTKRedirectOutput.cpp b/mrv2/lib/mrvPy/FLTKRedirectOutput.cpp index 934fdb07c..88891db2e 100644 --- a/mrv2/lib/mrvPy/FLTKRedirectOutput.cpp +++ b/mrv2/lib/mrvPy/FLTKRedirectOutput.cpp @@ -21,7 +21,7 @@ namespace mrv python_panel_cb(nullptr, App::ui); PythonOutput* output = PythonPanel::output(); output->info(message.c_str()); - std::cout << message << std::endl; + std::cout << message; } void flush() {} @@ -36,7 +36,7 @@ namespace mrv python_panel_cb(nullptr, App::ui); PythonOutput* output = PythonPanel::output(); output->error(message.c_str()); - std::cerr << message << std::endl; + std::cerr << message; } void flush() {} }; diff --git a/mrv2/lib/mrvWidgets/mrvPythonEditor.cpp b/mrv2/lib/mrvWidgets/mrvPythonEditor.cpp index 37a76b52a..d29a729ac 100644 --- a/mrv2/lib/mrvWidgets/mrvPythonEditor.cpp +++ b/mrv2/lib/mrvWidgets/mrvPythonEditor.cpp @@ -255,7 +255,6 @@ namespace mrv } if (skip || m_eval.substr(0, 1) == "#") { - m_code += "\n"; m_code += m_eval; m_eval.clear(); }