From c8ad411c2e2b6986266579447d8466c016c5258f Mon Sep 17 00:00:00 2001 From: Charles PIGNEROL <> Date: Fri, 20 Oct 2023 17:54:18 +0200 Subject: [PATCH 1/3] =?UTF-8?q?Correctifs=20historisation=20QtPython3,=20a?= =?UTF-8?q?cc=C3=A8s=20via=20touches=20haut/bas.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/QtPython3/QtPythonConsole.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/QtPython3/QtPythonConsole.cpp b/src/QtPython3/QtPythonConsole.cpp index b193c86..1d271eb 100644 --- a/src/QtPython3/QtPythonConsole.cpp +++ b/src/QtPython3/QtPythonConsole.cpp @@ -1555,7 +1555,8 @@ void QtPythonConsole::lineProcessedCallback (const string& fileName, size_t line ConsoleOutput::cerr ( ) << mess << co_endl; } - lineProcessedCallback (consoleLine, true, error); + lineProcessedCallback (consoleLine, ok, error); // v 6.3.1 (sinon ligne écrite 2 fois dans le script généré) +// lineProcessedCallback (consoleLine, true, error); } // QtPythonConsole::lineProcessedCallback @@ -1722,8 +1723,7 @@ void QtPythonConsole::addToHistoric ( if (linesCount > 1) { size_t i = 0; - for (vector::const_iterator itl = lines.begin ( ); - lines.end ( ) != itl; itl++, i++) + for (vector::const_iterator itl = lines.begin ( ); lines.end ( ) != itl; itl++, i++) { const string comms (0 == i ? comments.utf8 ( ) : string ( )); const string out (0 == i ? commandOutput.utf8 ( ) : string ( )); @@ -1748,15 +1748,19 @@ void QtPythonConsole::addToHistoric ( setTextCursor (cursor); if (false == scriptingLog.getComment ( ).empty ( )) // v 2.7.0 { - const UTF8String comment (PythonLogOutputStream::toComment (scriptingLog.getComment ( )), - Charset::UTF_8); + const UTF8String comment (PythonLogOutputStream::toComment (scriptingLog.getComment ( )), Charset::UTF_8); + const size_t commentLineNum = lineNumber (comment.utf8 ( )); // v 6.3.1 line += lineNumber (comment.utf8 ( )); cursor.insertText (UTF8TOQSTRING (comment)); cursor.insertText ("\n"); block = block.next ( ); cursor.setPosition (block.position ( ), QTextCursor::MoveAnchor); setTextCursor (cursor); + line -= commentLineNum; // v 6.3.1 } // if (false == scriptingLog.getComment ( ).empty ( )) + else + line--; // v 6.3.1 + if (true == statusErr) { UTF8String error (charset); @@ -2237,6 +2241,7 @@ void QtPythonConsole::addToHistoric (const string& instruction) const size_t size = _history.size ( ); +cout << __FILE__ << ' ' << __LINE__ << " QtPythonConsole::addToHistoric. REGISTERING COMMAND=" << instruction << endl; if ((0 == size) || (_history [size - 1] != instruction)) _history.push_back (instruction); From b903b4d5ffd9f727de47505f316833b996e0ff01 Mon Sep 17 00:00:00 2001 From: Charles PIGNEROL <> Date: Fri, 20 Oct 2023 18:14:00 +0200 Subject: [PATCH 2/3] =?UTF-8?q?Correctifs=20historisation=20QtPython3,=20a?= =?UTF-8?q?cc=C3=A8s=20via=20touches=20haut/bas.=20OK=20pour=20QtPython3,?= =?UTF-8?q?=20=C3=A0=20reporter=20sur=20QtPython.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/QtPython3/QtPythonConsole.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/QtPython3/QtPythonConsole.cpp b/src/QtPython3/QtPythonConsole.cpp index 1d271eb..116f39d 100644 --- a/src/QtPython3/QtPythonConsole.cpp +++ b/src/QtPython3/QtPythonConsole.cpp @@ -271,7 +271,10 @@ bool QtPythonConsole::Instruction::isRunnable (const string& instruction) // ============================================================================ -const QtPythonConsole::QtScriptTextFormat QtPythonConsole::QtScriptTextFormat::commentFormat (QtPythonConsole::QtScriptTextFormat::COMMENT); +// v 6.3.1 : on annule commentFormat, la colorisation QtPythonSyntaxHighlighter et il semble qu'il y ait un bogue (les commandes sont bleues dans certains cas +// pour une raison non élucidée), mais où ??? +//const QtPythonConsole::QtScriptTextFormat QtPythonConsole::QtScriptTextFormat::commentFormat (QtPythonConsole::QtScriptTextFormat::COMMENT); // v 6.3.1 +const QtPythonConsole::QtScriptTextFormat QtPythonConsole::QtScriptTextFormat::commentFormat (QtPythonConsole::QtScriptTextFormat::INSTRUCTION); // v 6.3.1 const QtPythonConsole::QtScriptTextFormat QtPythonConsole::QtScriptTextFormat::emptyLineFormat (QtPythonConsole::QtScriptTextFormat::BLANK); const QtPythonConsole::QtScriptTextFormat QtPythonConsole::QtScriptTextFormat::instructionFormat (QtPythonConsole::QtScriptTextFormat::INSTRUCTION); const QtPythonConsole::QtScriptTextFormat QtPythonConsole::QtScriptTextFormat::ranInstructionFormat (QtPythonConsole::QtScriptTextFormat::RAN_INSTRUCTION); From 731079666c073b7c89a35caa308e3fe65905c1b1 Mon Sep 17 00:00:00 2001 From: Charles PIGNEROL <> Date: Tue, 24 Oct 2023 11:36:17 +0200 Subject: [PATCH 3/3] Version 6.3.2. Python 3 console fixes: history management with the up/down arrow keys, color management of displays (sometimes blue instead of black). --- cmake/version.cmake | 4 ++-- src/QtPython3/QtPythonConsole.cpp | 15 +++++++-------- versions.txt | 8 ++++++++ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/cmake/version.cmake b/cmake/version.cmake index 7f095c7..26b9ef1 100644 --- a/cmake/version.cmake +++ b/cmake/version.cmake @@ -5,12 +5,12 @@ # Pour la bibliothèque QtPython : set (QT_PYTHON_MAJOR_VERSION "6") set (QT_PYTHON_MINOR_VERSION "3") -set (QT_PYTHON_RELEASE_VERSION "1") +set (QT_PYTHON_RELEASE_VERSION "2") set (QT_PYTHON_VERSION ${QT_PYTHON_MAJOR_VERSION}.${QT_PYTHON_MINOR_VERSION}.${QT_PYTHON_RELEASE_VERSION}) # Pour la bibliothèque QtPython3 : set (QT_PYTHON_3_MAJOR_VERSION "6") set (QT_PYTHON_3_MINOR_VERSION "3") -set (QT_PYTHON_3_RELEASE_VERSION "1") +set (QT_PYTHON_3_RELEASE_VERSION "2") set (QT_PYTHON_3_VERSION ${QT_PYTHON_3_MAJOR_VERSION}.${QT_PYTHON_3_MINOR_VERSION}.${QT_PYTHON_3_RELEASE_VERSION}) diff --git a/src/QtPython3/QtPythonConsole.cpp b/src/QtPython3/QtPythonConsole.cpp index 116f39d..7acac2e 100644 --- a/src/QtPython3/QtPythonConsole.cpp +++ b/src/QtPython3/QtPythonConsole.cpp @@ -271,10 +271,10 @@ bool QtPythonConsole::Instruction::isRunnable (const string& instruction) // ============================================================================ -// v 6.3.1 : on annule commentFormat, la colorisation QtPythonSyntaxHighlighter et il semble qu'il y ait un bogue (les commandes sont bleues dans certains cas +// v 6.3.2 : on annule commentFormat, la colorisation QtPythonSyntaxHighlighter et il semble qu'il y ait un bogue (les commandes sont bleues dans certains cas // pour une raison non élucidée), mais où ??? -//const QtPythonConsole::QtScriptTextFormat QtPythonConsole::QtScriptTextFormat::commentFormat (QtPythonConsole::QtScriptTextFormat::COMMENT); // v 6.3.1 -const QtPythonConsole::QtScriptTextFormat QtPythonConsole::QtScriptTextFormat::commentFormat (QtPythonConsole::QtScriptTextFormat::INSTRUCTION); // v 6.3.1 +//const QtPythonConsole::QtScriptTextFormat QtPythonConsole::QtScriptTextFormat::commentFormat (QtPythonConsole::QtScriptTextFormat::COMMENT); // v 6.3.2 +const QtPythonConsole::QtScriptTextFormat QtPythonConsole::QtScriptTextFormat::commentFormat (QtPythonConsole::QtScriptTextFormat::INSTRUCTION); // v 6.3.2 const QtPythonConsole::QtScriptTextFormat QtPythonConsole::QtScriptTextFormat::emptyLineFormat (QtPythonConsole::QtScriptTextFormat::BLANK); const QtPythonConsole::QtScriptTextFormat QtPythonConsole::QtScriptTextFormat::instructionFormat (QtPythonConsole::QtScriptTextFormat::INSTRUCTION); const QtPythonConsole::QtScriptTextFormat QtPythonConsole::QtScriptTextFormat::ranInstructionFormat (QtPythonConsole::QtScriptTextFormat::RAN_INSTRUCTION); @@ -1558,7 +1558,7 @@ void QtPythonConsole::lineProcessedCallback (const string& fileName, size_t line ConsoleOutput::cerr ( ) << mess << co_endl; } - lineProcessedCallback (consoleLine, ok, error); // v 6.3.1 (sinon ligne écrite 2 fois dans le script généré) + lineProcessedCallback (consoleLine, ok, error); // v 6.3.2 (sinon ligne écrite 2 fois dans le script généré) // lineProcessedCallback (consoleLine, true, error); } // QtPythonConsole::lineProcessedCallback @@ -1752,17 +1752,17 @@ void QtPythonConsole::addToHistoric ( if (false == scriptingLog.getComment ( ).empty ( )) // v 2.7.0 { const UTF8String comment (PythonLogOutputStream::toComment (scriptingLog.getComment ( )), Charset::UTF_8); - const size_t commentLineNum = lineNumber (comment.utf8 ( )); // v 6.3.1 + const size_t commentLineNum = lineNumber (comment.utf8 ( )); // v 6.3.2 line += lineNumber (comment.utf8 ( )); cursor.insertText (UTF8TOQSTRING (comment)); cursor.insertText ("\n"); block = block.next ( ); cursor.setPosition (block.position ( ), QTextCursor::MoveAnchor); setTextCursor (cursor); - line -= commentLineNum; // v 6.3.1 + line -= commentLineNum; // v 6.3.2 } // if (false == scriptingLog.getComment ( ).empty ( )) else - line--; // v 6.3.1 + line--; // v 6.3.2 if (true == statusErr) { @@ -2244,7 +2244,6 @@ void QtPythonConsole::addToHistoric (const string& instruction) const size_t size = _history.size ( ); -cout << __FILE__ << ' ' << __LINE__ << " QtPythonConsole::addToHistoric. REGISTERING COMMAND=" << instruction << endl; if ((0 == size) || (_history [size - 1] != instruction)) _history.push_back (instruction); diff --git a/versions.txt b/versions.txt index 941ccc9..867843a 100644 --- a/versions.txt +++ b/versions.txt @@ -1,3 +1,11 @@ +Version 6.3.2 : 24/10/23 +=============== + +Correctifs console python 3 : +- gestion de l'historique avec les touches flèche haut/bas. +- gestion couleur des affichages (parfois en bleu à la place du noir). + + Version 6.3.0 : 21/06/23 ===============