Skip to content

Commit 0d76a03

Browse files
Merge pull request #2 from LIHPC-Computational-Geometry/dev-6.3.2
Dev 6.3.2 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).
2 parents e0bf84a + 7310796 commit 0d76a03

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
lines changed

cmake/version.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
# Pour la bibliothèque QtPython :
66
set (QT_PYTHON_MAJOR_VERSION "6")
77
set (QT_PYTHON_MINOR_VERSION "3")
8-
set (QT_PYTHON_RELEASE_VERSION "1")
8+
set (QT_PYTHON_RELEASE_VERSION "2")
99
set (QT_PYTHON_VERSION ${QT_PYTHON_MAJOR_VERSION}.${QT_PYTHON_MINOR_VERSION}.${QT_PYTHON_RELEASE_VERSION})
1010

1111
# Pour la bibliothèque QtPython3 :
1212
set (QT_PYTHON_3_MAJOR_VERSION "6")
1313
set (QT_PYTHON_3_MINOR_VERSION "3")
14-
set (QT_PYTHON_3_RELEASE_VERSION "1")
14+
set (QT_PYTHON_3_RELEASE_VERSION "2")
1515
set (QT_PYTHON_3_VERSION ${QT_PYTHON_3_MAJOR_VERSION}.${QT_PYTHON_3_MINOR_VERSION}.${QT_PYTHON_3_RELEASE_VERSION})
1616

src/QtPython3/QtPythonConsole.cpp

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,10 @@ bool QtPythonConsole::Instruction::isRunnable (const string& instruction)
271271
// ============================================================================
272272

273273

274-
const QtPythonConsole::QtScriptTextFormat QtPythonConsole::QtScriptTextFormat::commentFormat (QtPythonConsole::QtScriptTextFormat::COMMENT);
274+
// 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
275+
// pour une raison non élucidée), mais où ???
276+
//const QtPythonConsole::QtScriptTextFormat QtPythonConsole::QtScriptTextFormat::commentFormat (QtPythonConsole::QtScriptTextFormat::COMMENT); // v 6.3.2
277+
const QtPythonConsole::QtScriptTextFormat QtPythonConsole::QtScriptTextFormat::commentFormat (QtPythonConsole::QtScriptTextFormat::INSTRUCTION); // v 6.3.2
275278
const QtPythonConsole::QtScriptTextFormat QtPythonConsole::QtScriptTextFormat::emptyLineFormat (QtPythonConsole::QtScriptTextFormat::BLANK);
276279
const QtPythonConsole::QtScriptTextFormat QtPythonConsole::QtScriptTextFormat::instructionFormat (QtPythonConsole::QtScriptTextFormat::INSTRUCTION);
277280
const QtPythonConsole::QtScriptTextFormat QtPythonConsole::QtScriptTextFormat::ranInstructionFormat (QtPythonConsole::QtScriptTextFormat::RAN_INSTRUCTION);
@@ -1555,7 +1558,8 @@ void QtPythonConsole::lineProcessedCallback (const string& fileName, size_t line
15551558
ConsoleOutput::cerr ( ) << mess << co_endl;
15561559
}
15571560

1558-
lineProcessedCallback (consoleLine, true, error);
1561+
lineProcessedCallback (consoleLine, ok, error); // v 6.3.2 (sinon ligne écrite 2 fois dans le script généré)
1562+
// lineProcessedCallback (consoleLine, true, error);
15591563
} // QtPythonConsole::lineProcessedCallback
15601564

15611565

@@ -1722,8 +1726,7 @@ void QtPythonConsole::addToHistoric (
17221726
if (linesCount > 1)
17231727
{
17241728
size_t i = 0;
1725-
for (vector<string>::const_iterator itl = lines.begin ( );
1726-
lines.end ( ) != itl; itl++, i++)
1729+
for (vector<string>::const_iterator itl = lines.begin ( ); lines.end ( ) != itl; itl++, i++)
17271730
{
17281731
const string comms (0 == i ? comments.utf8 ( ) : string ( ));
17291732
const string out (0 == i ? commandOutput.utf8 ( ) : string ( ));
@@ -1748,15 +1751,19 @@ void QtPythonConsole::addToHistoric (
17481751
setTextCursor (cursor);
17491752
if (false == scriptingLog.getComment ( ).empty ( )) // v 2.7.0
17501753
{
1751-
const UTF8String comment (PythonLogOutputStream::toComment (scriptingLog.getComment ( )),
1752-
Charset::UTF_8);
1754+
const UTF8String comment (PythonLogOutputStream::toComment (scriptingLog.getComment ( )), Charset::UTF_8);
1755+
const size_t commentLineNum = lineNumber (comment.utf8 ( )); // v 6.3.2
17531756
line += lineNumber (comment.utf8 ( ));
17541757
cursor.insertText (UTF8TOQSTRING (comment));
17551758
cursor.insertText ("\n");
17561759
block = block.next ( );
17571760
cursor.setPosition (block.position ( ), QTextCursor::MoveAnchor);
17581761
setTextCursor (cursor);
1762+
line -= commentLineNum; // v 6.3.2
17591763
} // if (false == scriptingLog.getComment ( ).empty ( ))
1764+
else
1765+
line--; // v 6.3.2
1766+
17601767
if (true == statusErr)
17611768
{
17621769
UTF8String error (charset);

versions.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
Version 6.3.2 : 24/10/23
2+
===============
3+
4+
Correctifs console python 3 :
5+
- gestion de l'historique avec les touches fl�che haut/bas.
6+
- gestion couleur des affichages (parfois en bleu � la place du noir).
7+
8+
19
Version 6.3.0 : 21/06/23
210
===============
311

0 commit comments

Comments
 (0)