diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-10-02 14:42:21 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-10-02 16:12:57 +0200 |
| commit | 604591ee13e39c4d9953fb56322ca85bdaf01e74 (patch) | |
| tree | d172b6507319aa73822bcc2971efda7d2f228641 /tools/snippets_translate/converter.py | |
| parent | c512b506b565578770c671b11afb78427ca8d012 (diff) | |
snippets_translate: Fix flake8-warnings
Change-Id: I91f211639846bb119d696244060f3013c52e59ed
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'tools/snippets_translate/converter.py')
| -rw-r--r-- | tools/snippets_translate/converter.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tools/snippets_translate/converter.py b/tools/snippets_translate/converter.py index 7179a94a0..e5880a09b 100644 --- a/tools/snippets_translate/converter.py +++ b/tools/snippets_translate/converter.py @@ -56,12 +56,12 @@ switch_branch = 0 def snippet_translate(x): global switch_var, switch_branch - ## Cases which are not C++ - ## TODO: Maybe expand this with lines that doesn't need to be translated + # # Cases which are not C++ + # # TODO: Maybe expand this with lines that doesn't need to be translated if x.strip().startswith("content-type: text/html"): return x - ## General Rules + # # General Rules # Remove ';' at the end of the lines has_semicolon = x.endswith(";") @@ -180,7 +180,7 @@ def snippet_translate(x): if "nullptr" in x: x = x.replace("nullptr", "None") - ## Special Cases Rules + # # Special Cases Rules xs = x.strip() # Special case for 'main' if xs.startswith("int main("): @@ -298,8 +298,7 @@ def snippet_translate(x): # with only alpha numeric content if VAR4_PATTERN.search(xs) and not xs.endswith(")"): v = x.rstrip() - if (not v.endswith(" True") and not v.endswith(" False") - and not v.endswith(" None")): + if (not v.endswith(" True") and not v.endswith(" False") and not v.endswith(" None")): x = f"{v}()" return dstrip(x) |
