Skip to content

Commit

Permalink
src/Tools/updatets.py: modernization tweeks
Browse files Browse the repository at this point in the history
Made CLI output more user-friendly especially since we're transitioning to py3/qt5 and the translation tools have different standards (minor changes).  
+ added Changelog
+ bumped version and added authors
  • Loading branch information
luzpaz authored and yorikvanhavre committed May 6, 2019
1 parent 519bbfe commit fa1a429
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions src/Tools/updatets.py
Expand Up @@ -25,19 +25,28 @@
#* *
#***************************************************************************

# Changelog:
# 0.3 User-friendly output
# Corrections
# Added Changelog
# 0.2 Add Qt5 support
# Add "no obsolete" flags in order to fix 'ghost strings' in Crowdin
# 0.1 Initial Release

from __future__ import print_function

Usage = """updatets - update all .ts files found in the source directories
Usage:
updatets
Author:
Authors:
(c) 2010 Werner Mayer
Licence: GPL
(c) 2019 FreeCAD Volunteers
Licence: LGPL
Version:
0.1
0.3
"""

import os, re
Expand Down Expand Up @@ -110,6 +119,7 @@

def find_tools(noobsolete=True):

print(Usage + "\nFirst, lets find all necessary tools on your system")
global QMAKE, LUPDATE, PYLUPDATE, LCONVERT
if (os.system("qmake -version") == 0):
QMAKE = "qmake"
Expand Down Expand Up @@ -152,7 +162,12 @@ def find_tools(noobsolete=True):
LCONVERT += " -no-obsolete"
else:
raise Exception("Cannot find lconvert")
print("Qt tools:", QMAKE, LUPDATE, PYLUPDATE, LCONVERT)
print("\nAll Qt tools have been found!\n",
"\t" + QMAKE + "\n",
"\t" + LUPDATE + "\n",
"\t" + PYLUPDATE + "\n",
"\t" + LCONVERT + "\n")
print("==============================================\n")

def filter_dirs(item):

Expand Down Expand Up @@ -213,7 +228,7 @@ def main():
update_translation(i)
for j in PyCommands:
update_python_translation(j)
print("\nIf updatets.py was run successully, the next step is to run ./src/Tools/updatecrowdin.py")

if __name__ == "__main__":
main()

0 comments on commit fa1a429

Please sign in to comment.