From 8d2f98a780a33c6d7fcaf60f5870c98f6aaef1e2 Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Sun, 16 Apr 2023 20:44:44 -0500 Subject: [PATCH] Tools/updatets.py: clean up file formatting issues. --- src/Tools/updatets.py | 53 ++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/src/Tools/updatets.py b/src/Tools/updatets.py index 0348549b7e..ba148d7153 100755 --- a/src/Tools/updatets.py +++ b/src/Tools/updatets.py @@ -1,29 +1,27 @@ #!/usr/bin/python3 -# -*- coding: utf-8 -*- -# (c) 2010 Werner Mayer LGPL - -#*************************************************************************** -#* * -#* Copyright (c) 2010 Werner Mayer * -#* * -#* This program is free software; you can redistribute it and/or modify * -#* it under the terms of the GNU Library General Public License (LGPL) * -#* as published by the Free Software Foundation; either version 2 of * -#* the License, or (at your option) any later version. * -#* for detail see the LICENCE text file. * -#* * -#* This program is distributed in the hope that it will be useful, * -#* but WITHOUT ANY WARRANTY; without even the implied warranty of * -#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -#* GNU Library General Public License for more details. * -#* * -#* You should have received a copy of the GNU Library General Public * -#* License along with this program; if not, write to the Free Software * -#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * -#* USA * -#* * -#*************************************************************************** +# SPDX-License-Identifier: LGPL-2.1-or-later +# *************************************************************************** +# * * +# * Copyright (c) 2010 Werner Mayer * +# * * +# * This file is part of FreeCAD. * +# * * +# * FreeCAD is free software: you can redistribute it and/or modify it * +# * under the terms of the GNU Lesser General Public License as * +# * published by the Free Software Foundation, either version 2.1 of the * +# * License, or (at your option) any later version. * +# * * +# * FreeCAD is distributed in the hope that it will be useful, but * +# * WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * +# * Lesser General Public License for more details. * +# * * +# * You should have received a copy of the GNU Lesser General Public * +# * License along with FreeCAD. If not, see * +# * . * +# * * +# *************************************************************************** # Changelog: # 0.5 Add support for Qt 6 lupdate (which fixes MANY bugs and should be preferred) @@ -60,7 +58,6 @@ directories = [ {"tsname":"FreeCAD", "workingdir":"./src/Gui", "tsdir":"Language"}, {"tsname":"AddonManager", "workingdir":"./src/Mod/AddonManager/", "tsdir":"Resources/translations"}, {"tsname":"Arch", "workingdir":"./src/Mod/Arch/", "tsdir":"Resources/translations"}, - #{"tsname":"Assembly", "workingdir":"./src/Mod/Assembly/", "tsdir":"Gui/Resources/translations"}, {"tsname":"Draft", "workingdir":"./src/Mod/Draft/", "tsdir":"Resources/translations"}, {"tsname":"Drawing", "workingdir":"./src/Mod/Drawing/", "tsdir":"Gui/Resources/translations"}, {"tsname":"Fem", "workingdir":"./src/Mod/Fem/", "tsdir":"Gui/Resources/translations"}, @@ -215,16 +212,16 @@ def update_translation(entry): file_list.write(os.path.join(root,f) + "\n") try: - p = subprocess.run([LUPDATE, "@files_to_translate.txt","-I","./", "-recursive", "-no-sort", "-ts", f"{tsBasename}.ts"], capture_output=True, timeout=60) + p = subprocess.run([LUPDATE, "@files_to_translate.txt","-I","./", "-recursive", "-no-sort", "-ts", f"{tsBasename}.ts"], capture_output=True, timeout=60, encoding="utf-8") except Exception as e: print(str(e)) os.chdir(cur) return - with open (f"{cur}/tsupdate_stdout.log","a") as f: + with open (f"{cur}/tsupdate_stdout.log", "a", encoding="utf-8") as f: f.write(p.stdout.decode()) print(p.stdout.decode()) - with open (f"{cur}/tsupdate_stderr.log","a") as f: + with open (f"{cur}/tsupdate_stderr.log", "a", encoding="utf-8") as f: f.write(p.stderr.decode()) # Strip out obsolete strings, and make sure there are no translations in the main *.ts file