Salome HOME
rename all the function to be pep0008 compliant
[tools/sat.git] / salomeTools.py
index 5e697edc89c4ac5fd14d45232991b363524070ba..65d909e07595abc4c2a16b76dd49a60ae445fe33 100755 (executable)
@@ -92,7 +92,7 @@ class Sat(object):
         self.options = options # the options passed to salomeTools
         self.dataDir = dataDir # default value will be <salomeTools root>/data
         # set the commands by calling the dedicated function
-        self.__setCommands__(cmdsdir)
+        self._setCommands(cmdsdir)
         
         # if the help option has been called, print help and exit
         if options.help:
@@ -113,7 +113,7 @@ class Sat(object):
         else:
             raise AttributeError(name + _(" is not a valid command"))
     
-    def __setCommands__(self, dirPath):
+    def _setCommands(self, dirPath):
         '''set class attributes corresponding to all commands that are in the dirPath directory
         
         :param dirPath str: The directory path containing the commands 
@@ -140,7 +140,7 @@ class Sat(object):
                 
                 # read the configuration from all the pyconf files    
                 cfgManager = config.ConfigManager()
-                self.cfg = cfgManager.getConfig(dataDir=self.dataDir, application=appliToLoad, options=self.options, command=__nameCmd__)
+                self.cfg = cfgManager.get_config(dataDir=self.dataDir, application=appliToLoad, options=self.options, command=__nameCmd__)
                     
                 # set output level
                 if self.options.output_level:
@@ -159,7 +159,7 @@ class Sat(object):
                 finally:
                     # put final attributes in xml log file (end time, total time, ...) and write it
                     launchedCommand = ' '.join([self.cfg.VARS.salometoolsway + os.path.sep + 'sat', self.arguments.split(' ')[0], args])
-                    logger_command.endWrite({"launchedCommand" : launchedCommand})
+                    logger_command.end_write({"launchedCommand" : launchedCommand})
                 
                 return res
 
@@ -185,7 +185,7 @@ class Sat(object):
         command = opt[0]
         # read the configuration from all the pyconf files    
         cfgManager = config.ConfigManager()
-        self.cfg = cfgManager.getConfig(dataDir=self.dataDir)
+        self.cfg = cfgManager.get_config(dataDir=self.dataDir)
 
         # Check if this command exists
         if not hasattr(self, command):
@@ -225,7 +225,7 @@ def print_version():
     '''
     # read the config 
     cfgManager = config.ConfigManager()
-    cfg = cfgManager.getConfig()
+    cfg = cfgManager.get_config()
     # print the key corresponding to salomeTools version
     print(src.printcolors.printcHeader( _("Version: ") ) + cfg.INTERNAL.sat_version + '\n')
 
@@ -262,8 +262,6 @@ def write_exception(exc):
 # MAIN : terminal command usage #
 # ###############################
 if __name__ == "__main__":  
-    # Get the command line using sys.argv
-    cmd_line = " ".join(sys.argv)
     # Initialize the code that will be returned by the terminal command 
     code = 0
     (options, args) = parser.parse_args(sys.argv[1:])