[Libreoffice-commits] dictionaries.git: cs_CZ/thesaurus

Mattia Rizzolo (via logerrit) logerrit at kemper.freedesktop.org
Thu Oct 24 12:28:30 UTC 2019


 cs_CZ/thesaurus/dictionary-to-thesaurus.py |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 41c5fc0693d6ca4a0934d859ebb39659339e968d
Author:     Mattia Rizzolo <mattia at mapreri.org>
AuthorDate: Wed Oct 23 17:59:07 2019 +0200
Commit:     Michael Stahl <michael.stahl at cib.de>
CommitDate: Thu Oct 24 14:28:09 2019 +0200

    tdf#128341 use python3
    
    Change-Id: Ic8deb039da037bd270c39da03f8697a9ab034ff0
    Signed-off-by: Mattia Rizzolo <mattia at mapreri.org>
    Reviewed-on: https://gerrit.libreoffice.org/81410
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    Tested-by: Michael Stahl <michael.stahl at cib.de>

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)
 
 


More information about the Libreoffice-commits mailing list