Salome HOME
style: black format
[tools/sat.git] / data / templates / Application / config / compile.py
index 245df7b5c1f4fbdc8dae647b67681bad99d51b83..21b048654a68f816296fc99c1033869b8fb86772 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-#-*- coding:utf-8 -*-
+# -*- coding:utf-8 -*-
 
 # This script is used to build the application module.
 # First, it copies the content of the sources directory to the install directory.
@@ -9,28 +9,40 @@ import subprocess
 
 import src
 
+
 def compil(config, builder, logger):
     builder.prepare()
     if not builder.source_dir.smartcopy(builder.install_dir):
-        raise src.SatException(_("Error when copying %s sources to install dir") % builder.product_info.name)
-    
+        raise src.SatException(
+            _("Error when copying %s sources to install dir")
+            % builder.product_info.name
+        )
+
     # test lrelease #.pyconf needs in ..._APPLI pre_depend : ['qt']
-    command = "which lrelease" 
-    res = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE,env=builder.build_environ.environ.environ).communicate()
-    if res[1] != "": #an error occured
+    command = "which lrelease"
+    res = subprocess.Popen(
+        command,
+        shell=True,
+        stdout=subprocess.PIPE,
+        stderr=subprocess.PIPE,
+        env=builder.build_environ.environ.environ,
+    ).communicate()
+    if res[1] != "":  # an error occured
         logger.write("ERROR: %s" % res[1])
-        builder.log(res[1]+"\n")
+        builder.log(res[1] + "\n")
         return 1
-    
+
     # run lrelease
     command = "lrelease *.ts"
-    res = subprocess.call(command,
-                          shell=True,
-                          cwd=str(builder.install_dir + "resources"),
-                          env=builder.build_environ.environ.environ,
-                          stdout=logger.logTxtFile,
-                          stderr=subprocess.STDOUT)
+    res = subprocess.call(
+        command,
+        shell=True,
+        cwd=str(builder.install_dir + "resources"),
+        env=builder.build_environ.environ.environ,
+        stdout=logger.logTxtFile,
+        stderr=subprocess.STDOUT,
+    )
     if res != 0:
         res = 1
-    
+
     return res