diff options
author | Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> | 2024-07-25 16:48:49 +0300 |
---|---|---|
committer | Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> | 2024-07-25 15:50:32 +0200 |
commit | ff6b674fc9034f2f70f78159c0bb16924d8ff2c1 (patch) | |
tree | 32ca60f2d56ce1e187bbe2b64669f0f51d55caed /helpers | |
parent | e35fb29cb092771840ff876bbb4350e7570e1627 (diff) |
helpers: fix issues found by Ruff linter
Change-Id: I0fd932259a79bef030d6450a2770cb28c4c840b7
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/171015
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Tested-by: Jenkins
Diffstat (limited to 'helpers')
-rwxr-xr-x | helpers/convertfilters.py | 9 | ||||
-rw-r--r-- | helpers/make_icon_link.txt.py | 24 |
2 files changed, 15 insertions, 18 deletions
diff --git a/helpers/convertfilters.py b/helpers/convertfilters.py index 863cbb23e2..c2557205cc 100755 --- a/helpers/convertfilters.py +++ b/helpers/convertfilters.py @@ -16,9 +16,6 @@ import os import sys -import random -import time -from math import floor from lxml import etree output_file_path = os.path.join(os.path.dirname(sys.argv[0]), "convertfilters.xhp") @@ -169,11 +166,11 @@ for module in modules: </tablecell>\n\ </tablerow>\n' - output += f'\ + output += '\ </table>\n\ </section>\n' -output += f'\ +output += '\ </body>\n\ </helpdocument>' @@ -181,4 +178,4 @@ with open(output_file_path, "w") as f: f.write(output) print(f'\nDone. File saved at: {output_file_path}.') -print(f'Please move this file into helpcontent2/source/text/shared/guide.') +print('Please move this file into helpcontent2/source/text/shared/guide.') diff --git a/helpers/make_icon_link.txt.py b/helpers/make_icon_link.txt.py index 573af4050c..d8f37f3765 100644 --- a/helpers/make_icon_link.txt.py +++ b/helpers/make_icon_link.txt.py @@ -26,23 +26,23 @@ except IOError: print("There was an error writing", file_xsl) sys.exit() -file_xsl.write('<?xml version="1.0" encoding="UTF-8"?>\n'); -file_xsl.write('<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">\n'); -file_xsl.write('<xsl:template name="linktxt">\n'); -file_xsl.write('<xsl:param name="src1"/>\n'); +file_xsl.write('<?xml version="1.0" encoding="UTF-8"?>\n') +file_xsl.write('<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">\n') +file_xsl.write('<xsl:template name="linktxt">\n') +file_xsl.write('<xsl:param name="src1"/>\n') file_xsl.write('<xsl:choose>\n') for line in file_icon: if line[0] != "#" : if line.find('png',0, len(line)) != -1 : - a = "\'" + line.split()[0] + "\'"; - b = line.split()[1].replace(".png",".svg"); - file_xsl.write('<xsl:when test="$src1=' + a + '"><xsl:text>'+ b + '</xsl:text></xsl:when>\n'); - -file_xsl.write('<xsl:otherwise><xsl:value-of select="$src1"/></xsl:otherwise>\n'); -file_xsl.write('</xsl:choose>\n'); -file_xsl.write('</xsl:template>\n'); -file_xsl.write('</xsl:stylesheet>\n'); + a = "\'" + line.split()[0] + "\'" + b = line.split()[1].replace(".png",".svg") + file_xsl.write('<xsl:when test="$src1=' + a + '"><xsl:text>'+ b + '</xsl:text></xsl:when>\n') + +file_xsl.write('<xsl:otherwise><xsl:value-of select="$src1"/></xsl:otherwise>\n') +file_xsl.write('</xsl:choose>\n') +file_xsl.write('</xsl:template>\n') +file_xsl.write('</xsl:stylesheet>\n') file_xsl.close() file_icon.close() |