]> SALOME platform Git repositories - tools/sat.git/commitdiff
Salome HOME
Merge branch 'master' of /home/salome/GitRepo/salomeTools-5
authorSerge Rehbinder <serge.rehbinder@cea.fr>
Tue, 29 Nov 2016 08:55:43 +0000 (09:55 +0100)
committerSerge Rehbinder <serge.rehbinder@cea.fr>
Tue, 29 Nov 2016 08:55:43 +0000 (09:55 +0100)
commands/config.py
commands/jobs.py

index af657c9071beaa4be41864a3162aa49046bd4833..9023b0758acbccee193e76690e9109328a442b8a 100644 (file)
@@ -285,7 +285,7 @@ class ConfigManager:
             if not os.path.exists(project_pyconf_path):
                 msg = _("WARNING: The project file %s cannot be found. "
                         "It will be ignored\n" % project_pyconf_path)
-                sys.stdout.write(src.printcolors.printcWarning(msg))
+                sys.stdout.write(msg)
                 continue
             project_name = os.path.basename(
                                     project_pyconf_path)[:-len(".pyconf")]
index ce9a19d918b0cfd24ca1d1c7d210ee7bcadf006c..fb8497e03984a221f46b1d2ae7e924e8652279c5 100644 (file)
@@ -267,7 +267,8 @@ class Job(object):
 
         self.out = ""
         self.err = ""
-               
+        
+        name_remote_jobs_pyconf = ".jobs_command_file.pyconf"
         self.commands = commands
         self.command = (os.path.join(self.machine.sat_path, "sat") +
                         " -l " +
@@ -1043,7 +1044,13 @@ class Gui(object):
        see the jobs states
     '''
    
-    def __init__(self, xml_dir_path, l_jobs, l_jobs_not_today, prefix, file_boards=""):
+    def __init__(self,
+                 xml_dir_path,
+                 l_jobs,
+                 l_jobs_not_today,
+                 prefix,
+                 logger,
+                 file_boards=""):
         '''Initialization
         
         :param xml_dir_path str: The path to the directory where to put 
@@ -1053,6 +1060,9 @@ class Gui(object):
         :param file_boards str: the file path from which to read the
                                    expected boards
         '''
+        # The logging instance
+        self.logger = logger
+        
         # The prefix to add to the xml files : date_hour
         self.prefix = prefix
         
@@ -1084,7 +1094,7 @@ class Gui(object):
 
         # Create the lines and columns
         self.initialize_boards(l_jobs, l_jobs_not_today)
-        
+
         # Write the xml file
         self.update_xml_files(l_jobs)
     
@@ -1277,8 +1287,15 @@ class Gui(object):
         for file_name in os.listdir(self.xml_dir_path):
             if oExpr.search(file_name):
                 file_path = os.path.join(self.xml_dir_path, file_name)
-                global_xml = src.xmlManager.ReadXmlFile(file_path)
-                l_globalxml.append(global_xml)
+                try:
+                    global_xml = src.xmlManager.ReadXmlFile(file_path)
+                    l_globalxml.append(global_xml)
+                except Exception as e:
+                    msg = _("\nWARNING: the file %s can not be read, it will be "
+                            "ignored\n%s" % (file_path, e))
+                    self.logger.write("%s\n" % src.printcolors.printcWarning(
+                                                                        msg), 5)
+                    
 
         # Construct the dictionnary self.history 
         for job in l_jobs + l_jobs_not_today:
@@ -1652,6 +1669,7 @@ def run(args, runner, logger):
                   today_jobs.ljobs,
                   today_jobs.ljobs_not_today,
                   runner.cfg.VARS.datehour,
+                  logger,
                   file_boards = options.input_boards)
         
         logger.write(src.printcolors.printcSuccess("OK"), 5)
@@ -1707,4 +1725,4 @@ def run(args, runner, logger):
                 today_jobs.gui.last_update()
         # Output the results
         today_jobs.write_all_results()
-        return res
\ No newline at end of file
+        return res