OSDN Git Service

simplify translations script
authorIvailo Monev <xakepa10@gmail.com>
Wed, 30 Dec 2015 08:44:42 +0000 (10:44 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Wed, 30 Dec 2015 08:44:42 +0000 (10:44 +0200)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
scripts/updatetranslations.py

index 01d84f6..55a38e6 100755 (executable)
@@ -26,16 +26,12 @@ for t in tools:
 
 for t in glob.glob('translations/qt*.ts'):
     if 'tools' in t:
-        command = 'build/bin/lupdate -locations relative -no-ui-lines -no-obsolete %s -ts %s' % (' '.join(tfiles), t)
-        command = shlex.split(command)
-        pipe = subprocess.Popen(command, stderr=subprocess.PIPE)
-        pipe.wait()
-        if pipe.returncode != 0:
-            raise(Exception(pipe.communicate()[1].strip()))
+        files = ' '.join(tfiles)
     else:
-        command = 'build/bin/lupdate -locations relative -no-ui-lines -no-obsolete %s -ts %s' % (' '.join(cfiles), t)
-        command = shlex.split(command)
-        pipe = subprocess.Popen(command, stderr=subprocess.PIPE)
-        pipe.wait()
-        if pipe.returncode != 0:
-            raise(Exception(pipe.communicate()[1].strip()))
+        files = ' '.join(cfiles)
+    command = 'build/bin/lupdate -locations relative -no-ui-lines -no-obsolete %s -ts %s' % (files, t)
+    command = shlex.split(command)
+    pipe = subprocess.Popen(command, stderr=subprocess.PIPE)
+    pipe.wait()
+    if pipe.returncode != 0:
+        raise(Exception(pipe.communicate()[1].strip()))