aboutsummaryrefslogtreecommitdiffstats
path: root/tools/snippets_translate
Commit message (Collapse)AuthorAgeFilesLines
* doc: snippets_translate make quiet mode by defaultCristian Maureira-Fredes2021-04-281-23/+24
| | | | | | | | | | | | | | | | | Without being 'quiet' the script was generating output to the stdout and stderr, which was triggering the cmake instruction to make the build fail This change makes the quiet mode by default, the old output that summarize each snippet file can be obtained by using the '--verbose' option. A new option called '--debug' was introduced to get even more output related to each translation happening per file. Pick-to: 6.0.4 Change-Id: I7fce09f0b60e626c957efc4fe24948e0eaf3db74 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* doc: fatal error when snippet conversion failsCristian Maureira-Fredes2021-04-263-7/+1553
| | | | | | | | | | | | | | | | | | | | | | When the snippets_translate tool fails, the build process continues normally, falling back to use the original C++ snippets. This problem can be dangerous, since we will not notice if something is wrong without checking the full log. This patch make the build process to fail when the tool doesn't exit normally. For builds where the documentation generation is skipped, this change will have no effect. Complementary to this, the patch includes a new Python file to determine if the C++ include have an import counterpart in Python. Fixes: PYSIDE-1527 Pick-to: 6.0.4 Change-Id: I725b623f60dbc540a6e7834502300c39cd22b5a3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* snippets_translate: Do not crash on multi-line emit statementsFriedemann Kleint2021-04-161-1/+8
| | | | | | | | | | | qtbase/0e69349f6f8e9445877ea5b2105973115ad79cf7 introduced a multi-line emit statement, causing snippets_translate to fail. Add a warning message which then shows: snippets_translate: Warning "emit renderedImage(result, resultSize," does not match function call Change-Id: Id27770eab1e60d7828e7d742e63d1de2d530ad02 Reviewed-by: Christian Tismer <tismer@stackless.com>
* doc: snippet translate add missing quiet caseCristian Maureira-Fredes2021-03-261-1/+2
| | | | | | Pick-to: 6.0 Change-Id: I6d3520e9544d7d169a9c933a8aa904747bc7c6c4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* doc: enable snippets translate toolCristian Maureira-Fredes2021-03-251-26/+53
| | | | | | | | | | | | | | | | Create snippets directories in case they don't exist. Add "-q" option as the examples directory to keep the "--quiet" option from the build. Something to consider with this patch: Removing all the previous old snippets, which include not only 'cpp' files, but also '.h', '.qdoc', '.qrc', '.png', and '.qml', which might be used in the snippets, but will need to be updated in the generation tool, to not translate, and copy them over. Pick-to: 6.0 Change-Id: Icbef9e1c93a12b90dbcfa990ef055ca6f8868407 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Long live snippets_translate!Cristian Maureira-Fredes2021-03-188-0/+2031
This is not a C++ -> Python translator, but a line-by-line conversion tool. This scripts requires two arguments to identify a Qt and PySide directory including the sources. There is a set of file extensions that are currently omitted from the process, and for the ones that will be copied, there will be messages related if the file already exists or if it's new. If you use the '-v' option, you will see the C++ code and the converted Python code, so it's easy to check for issues and missing features. Also, two command line options were added to have a different behavior '--filter' to include a word to filter the full paths of all the snippets found (for example the name of a directory), and '-s/--single' to translate only a specific C++ file to be translated. Including test cases for transformations related to the C++ snippets. Fixes: PYSIDE-691 Pick-to: 6.0 Change-Id: I208e3a9139c7e84fe369a7c2ea93af240d83fa83 Reviewed-by: Christian Tismer <tismer@stackless.com>