Commit 5b277b5d authored by Johnny Jazeix's avatar Johnny Jazeix

core, remove all python2 occurences

parent 69a32fc6
......@@ -208,7 +208,7 @@ include(cmake/rcc.cmake)
# Simple command calling the python script
add_custom_command(
OUTPUT retrievePoFilesFromSvn
COMMAND python2 tools/l10n-fetch-po-files.py
COMMAND python tools/l10n-fetch-po-files.py
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
# Install translations
......@@ -217,7 +217,7 @@ add_custom_target(getSvnTranslations
COMMENT "Re-run cmake after this to be able to run BuildTranslations with the latest files"
)
# Get all po files in po/. You can get them doing: python2 tools/l10n-fetch-po-files.py
# Get all po files in po/. You can get them doing: python tools/l10n-fetch-po-files.py
file(GLOB TRANSLATIONS_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "po/*.po")
# Set the output dir for the translation files to /bin
foreach(PoSource ${TRANSLATIONS_FILES})
......
#!/usr/bin/python2
#!/usr/bin/python
#
# GCompris - mergePo.py
#
......@@ -19,12 +19,12 @@
# Using polib.py from https://bitbucket.org/izi/polib/wiki/Home
# Usage : python2 mergePo.py qt.po gtk.po
# Usage : python mergePo.py qt.po gtk.po
# Find in the first argument po file the translated lines of the gtk po file
# (if existing) and replace the translation for the po file.
# For those not found, no translation is provided.
# something like: python2 mergePo.py gcompris_fi.po fi.po && sed '/^#|/ d' < gcompris_fi.po > qtgl.po && mv qtgl.po gcompris_fi.po
# something like: python mergePo.py gcompris_fi.po fi.po && sed '/^#|/ d' < gcompris_fi.po > qtgl.po && mv qtgl.po gcompris_fi.po
import sys
import polib
......
......@@ -43,13 +43,13 @@ if not os.path.exists(OUTPUT_PO_PATH):
all_languages = subprocess.check_output(['svn', 'cat', SVN_PATH + 'subdirs'],
stderr=subprocess.STDOUT)
all_languages = [x.strip() for x in all_languages.split("\n") if len(x)]
all_languages = [x.strip() for x in all_languages.decode().split("\n") if len(x)]
all_languages.remove("x-test")
for lang in all_languages:
try:
raw_data = subprocess.check_output(['svn', 'cat', SVN_PATH + lang + SOURCE_PO_PATH],
stderr=subprocess.PIPE)
(transformed, subs) = fixer.subn('# ~| ', raw_data)
(transformed, subs) = fixer.subn('# ~| ', raw_data.decode())
pos1 = re_empty_msgid.search(transformed).start()
pos2 = re_empty_line.search(transformed).start()
if re_has_qt_contexts.search(transformed, pos1, pos2) is None:
......@@ -58,12 +58,13 @@ for lang in all_languages:
transformed[pos2:]
subs = subs + 1
if (subs > 0):
print "Fetched %s (and performed %d cleanups)" % (lang, subs)
print("Fetched %s (and performed %d cleanups)" % (lang, subs))
else:
print "Fetched %s" % lang
file(OUTPUT_PO_PATH + OUTPUT_PO_PATTERN % lang, "wb").write(transformed)
print("Fetched %s" % lang)
out_file = open(OUTPUT_PO_PATH + OUTPUT_PO_PATTERN % lang, "wb")
out_file.write(transformed.encode())
except subprocess.CalledProcessError:
print "No data for %s" % lang
print ("No data for %s" % lang)
# Inform qmake about the updated file list
#os.utime("CMakeLists.txt", None)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment