From 41c5fc0693d6ca4a0934d859ebb39659339e968d Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Wed, 23 Oct 2019 17:59:07 +0200 Subject: tdf#128341 use python3 Change-Id: Ic8deb039da037bd270c39da03f8697a9ab034ff0 Signed-off-by: Mattia Rizzolo Reviewed-on: https://gerrit.libreoffice.org/81410 Reviewed-by: Michael Stahl Tested-by: Michael Stahl --- cs_CZ/thesaurus/dictionary-to-thesaurus.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cs_CZ/thesaurus/dictionary-to-thesaurus.py b/cs_CZ/thesaurus/dictionary-to-thesaurus.py index ac4fe67..8a40056 100755 --- a/cs_CZ/thesaurus/dictionary-to-thesaurus.py +++ b/cs_CZ/thesaurus/dictionary-to-thesaurus.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # coding=utf-8 # # This file is part of the LibreOffice project. @@ -61,8 +61,8 @@ def parse(filename, blacklistname): meanings = {} classification = {} - match_ignore = re.compile('(\[neprav\.\]|\[vulg\.\])') - match_cleanup = re.compile('(\[.*\]|\*|:.*)') + match_ignore = re.compile(r'(\[neprav\.\]|\[vulg\.\])') + match_cleanup = re.compile(r'(\[.*\]|\*|:.*)') with open(filename, "r") as fp: for line in fp: @@ -172,7 +172,7 @@ def buildThesaurus(synonyms, meanings, classification): output_lines.append((t, line[t])) if len(output_lines) > 0: - print word + '|' + str(len(output_lines)) + print(word + '|' + str(len(output_lines))) # those with existing classification are probably a better fit, # put them to the front (even if we don't output the @@ -182,9 +182,9 @@ def buildThesaurus(synonyms, meanings, classification): # first pass only non-empty, 2nd pass only empty if (i == 0 and t != '') or (i == 1 and t == ''): if typ == '': - print t + line + print(t + line) else: - print line + print(line) def main(args): @@ -194,7 +194,7 @@ def main(args): (synonyms, meanings, classification) = parse(args[1], args[2]) - print "UTF-8" + print("UTF-8") buildThesaurus(synonyms, meanings, classification) -- cgit