From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:06:44 +0200 Subject: Adding upstream version 4:7.4.7. Signed-off-by: Daniel Baumann --- helpcontent2/helpers/make_icon_link.txt.py | 49 ++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 helpcontent2/helpers/make_icon_link.txt.py (limited to 'helpcontent2/helpers/make_icon_link.txt.py') diff --git a/helpcontent2/helpers/make_icon_link.txt.py b/helpcontent2/helpers/make_icon_link.txt.py new file mode 100644 index 000000000..573af4050 --- /dev/null +++ b/helpcontent2/helpers/make_icon_link.txt.py @@ -0,0 +1,49 @@ +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# +# Generate XSL equivalent for Colibre icon images from link.txt +# + +import sys + +try: + # open file stream + file_icon = open(sys.argv[1], "r") + +except IOError: + print("There was an error reading", file_icon) + sys.exit() +try: + # open file stream + file_xsl = open(sys.argv[2], "w+") + +except IOError: + print("There was an error writing", file_xsl) + sys.exit() + +file_xsl.write('\n'); +file_xsl.write('\n'); +file_xsl.write('\n'); +file_xsl.write('\n'); +file_xsl.write('\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(''+ b + '\n'); + +file_xsl.write('\n'); +file_xsl.write('\n'); +file_xsl.write('\n'); +file_xsl.write('\n'); + +file_xsl.close() +file_icon.close() +sys.exit() -- cgit v1.2.3