From b8394d824afdb1d47f7f3888f8a2d84a912eefcb Mon Sep 17 00:00:00 2001 From: Michael W Date: Sat, 28 Mar 2020 20:49:37 +0100 Subject: crowdin: Fix console-output on download * When we have errors or messages during cleanup, the string is currently in the wrong line Change-Id: Ic06509019f96c02f9602330908e612d7a77deb01 --- crowdin_sync.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crowdin_sync.py b/crowdin_sync.py index f64e1d4..924c7c1 100755 --- a/crowdin_sync.py +++ b/crowdin_sync.py @@ -137,7 +137,7 @@ def clean_xml_file(base_path, project_path, filename, repo): try: fh = open(path, 'r+') except: - print('Something went wrong while opening file %s' % (path)) + print('\nSomething went wrong while opening file %s' % (path)) return XML = fh.read() @@ -173,8 +173,8 @@ def clean_xml_file(base_path, project_path, filename, repo): # Every occurance of the string has to be removed when no string with the same name and # 'product=default' (or no product attribute) was found if not hasProductDefault: - print("{0}: Found string '{1}' with missing 'product=default' attribute" - .format(path, stringName)) + print("\n{0}: Found string '{1}' with missing 'product=default' attribute" + .format(path, stringName), end='') for string in stringsWithSameName: tree.remove(string) alreadyRemoved.append(string) @@ -213,7 +213,7 @@ def clean_xml_file(base_path, project_path, filename, repo): # Remove files which don't have any translated strings contentList = list(tree) if len(contentList) == 0: - print('Removing ' + path) + print('\nRemoving ' + path) os.remove(path) @@ -246,7 +246,7 @@ def reset_file(filepath, repo): def push_as_commit(config_files, base_path, path, name, branch, username): - print('Committing %s on branch %s: ' % (name, branch), end='') + print('\nCommitting %s on branch %s: ' % (name, branch), end='') # Get path project_path = path -- cgit v1.2.3