From f0f329b4024bb1bf51752d09c8339d483efef0b7 Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Fri, 26 Oct 2018 20:46:02 +0300 Subject: [PATCH] Fix indentation in tstool.py --- src/webui/www/tstool.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/webui/www/tstool.py b/src/webui/www/tstool.py index 10cdd5741..eb3031afa 100755 --- a/src/webui/www/tstool.py +++ b/src/webui/www/tstool.py @@ -44,15 +44,15 @@ ts_folder = os.path.join(www_folder, "translations") def parseSource(filename, sources): print("Parsing %s..." % (os.path.normpath(filename))) with open(filename, encoding = 'utf-8', mode = 'r') as file: - regex = re.compile( - r"QBT_TR\((([^\)]|\)(?!QBT_TR))+)\)QBT_TR\[CONTEXT=([a-zA-Z_][a-zA-Z0-9_]*)\]") - for match in regex.finditer(file.read()): - string = match.group(1) - context = match.group(3) + regex = re.compile( + r"QBT_TR\((([^\)]|\)(?!QBT_TR))+)\)QBT_TR\[CONTEXT=([a-zA-Z_][a-zA-Z0-9_]*)\]") + for match in regex.finditer(file.read()): + string = match.group(1) + context = match.group(3) - if context not in sources: - sources[context] = set() - sources[context].add(string) + if context not in sources: + sources[context] = set() + sources[context].add(string) def processTranslation(filename, sources): print('Processing %s...' % (os.path.normpath(filename))) @@ -132,9 +132,9 @@ def processTranslation(filename, sources): try: with open(filename, mode = 'wb') as file: - file.write(b'\n' - b'\n') - tree.write(file, encoding = 'utf-8') + file.write(b'\n' + b'\n') + tree.write(file, encoding = 'utf-8') except Exception: print('\tFailed to write %s!' % (os.path.normpath(filename)))