tdf#128341 use python3

Change-Id: Ic8deb039da037bd270c39da03f8697a9ab034ff0
Signed-off-by: Mattia Rizzolo <mattia@mapreri.org>
Reviewed-on: https://gerrit.libreoffice.org/81410
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Tested-by: Michael Stahl <michael.stahl@cib.de>
This commit is contained in:
Mattia Rizzolo
2019-10-23 17:59:07 +02:00
committed by Michael Stahl
parent c15c2a8889
commit 41c5fc0693

View File

@ -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)