diff options
-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() |