From c3672f6e1dcadb77afbe9710107c89d3e700a0cd Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Wed, 28 Oct 2020 10:45:44 +0100 Subject: [PATCH] Tools: Made updatets delete temporary json files --- src/Tools/updatets.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Tools/updatets.py b/src/Tools/updatets.py index 5f54332283..94b3996eba 100755 --- a/src/Tools/updatets.py +++ b/src/Tools/updatets.py @@ -187,6 +187,7 @@ def update_translation(path): global QMAKE, LUPDATE cur = os.getcwd() os.chdir(path) + existingjsons = [f for f in os.listdir(".") if f.endswith(".json")] filename = os.path.basename(path) + ".pro" os.system(QMAKE + " -project") #os.system(LUPDATE + " " + filename) @@ -198,6 +199,10 @@ def update_translation(path): tsname = " -ts "+os.path.join("Language", "FreeCAD.ts") os.system(LUPDATE + " " + filename + tsname) os.remove(filename) + # lupdate creates json files since Qt5.something. Remove them here too + for jsonfile in [f for f in os.listdir(".") if f.endswith(".json")]: + if not jsonfile in existingjsons: + os.remove(jsonfile) os.chdir(cur) def update_python_translation(item):