aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2022-08-10 10:33:21 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2022-08-10 14:23:55 +0200
commitdf9c852d6cd6a3aff5d93ff17fcee38dc9e7088b (patch)
tree7ee2217a2fcc3dda8cfad6bcda79bcdf779e24e1
parentb4fc1c5d81053d30a9b03fe8a0d15336f024ed7a (diff)
shiboken6: Remove Python code snippet markers
Task-number: PYSIDE-1984 Task-number: PYSIDE-1952 Pick-to: 6.3 6.2 Change-Id: I2e74b9c3d26c8d9fb60480c052189630ff54eded Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
-rw-r--r--sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp b/sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp
index c29d2596c..6a358e0c9 100644
--- a/sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp
+++ b/sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp
@@ -598,15 +598,18 @@ QString QtXmlToSphinx::readFromLocation(const QString &location, const QString &
const QRegularExpression searchString(u"//!\\s*\\["_s
+ identifier + u"\\]"_s);
Q_ASSERT(searchString.isValid());
- static const QRegularExpression codeSnippetCode(u"//!\\s*\\[[\\w\\d\\s]+\\]"_s);
- Q_ASSERT(codeSnippetCode.isValid());
+ static const QRegularExpression cppCodeSnippetCode(u"//!\\s*\\[[\\w\\d\\s]+\\]"_s);
+ Q_ASSERT(cppCodeSnippetCode.isValid());
+ static const QRegularExpression pythonCodeSnippetCode(u"#!\\s*\\[[\\w\\d\\s]+\\]"_s);
+ Q_ASSERT(pythonCodeSnippetCode.isValid());
bool getCode = false;
while (!inputFile.atEnd()) {
QString line = QString::fromUtf8(inputFile.readLine());
if (getCode && !line.contains(searchString)) {
- line.remove(codeSnippetCode);
+ line.remove(cppCodeSnippetCode);
+ line.remove(pythonCodeSnippetCode);
code += line;
} else if (line.contains(searchString)) {
if (getCode)