]> SALOME platform Git repositories - tools/sat.git/commitdiff
Salome HOME
rename 'dataDir' to 'datadir' and 'workDir' to 'workdir'
authorSerge Rehbinder <serge.rehbinder@cea.fr>
Wed, 16 Mar 2016 10:17:37 +0000 (11:17 +0100)
committerSerge Rehbinder <serge.rehbinder@cea.fr>
Wed, 16 Mar 2016 10:17:37 +0000 (11:17 +0100)
commands/config.py
commands/log.py
data/site.pyconf
salomeTools.py
test/prepare/test_prepare.py

index 4c9868770a6cbb08286cf65f1c468117296d3e77..f12e7244522a33b75a4a7af6c6c9df1751c9b590 100644 (file)
@@ -77,16 +77,16 @@ class ConfigOpener:
 class ConfigManager:
     '''Class that manages the read of all the configuration files of salomeTools
     '''
-    def __init__(self, dataDir=None):
+    def __init__(self, datadir=None):
         pass
 
-    def _create_vars(self, application=None, command=None, dataDir=None):
+    def _create_vars(self, application=None, command=None, datadir=None):
         '''Create a dictionary that stores all information about machine,
            user, date, repositories, etc...
         
         :param application str: The application for which salomeTools is called.
         :param command str: The command that is called.
-        :param dataDir str: The repository that contain external data 
+        :param datadir str: The repository that contain external data 
                             for salomeTools.
         :return: The dictionary that stores all information.
         :rtype: dict
@@ -98,10 +98,10 @@ class ConfigManager:
         var['srcDir'] = os.path.join(var['salometoolsway'], 'src')
         var['sep']= os.path.sep
         
-        # dataDir has a default location
-        var['dataDir'] = os.path.join(var['salometoolsway'], 'data')
-        if dataDir is not None:
-            var['dataDir'] = dataDir
+        # datadir has a default location
+        var['datadir'] = os.path.join(var['salometoolsway'], 'data')
+        if datadir is not None:
+            var['datadir'] = datadir
 
         var['personalDir'] = os.path.join(os.path.expanduser('~'),
                                            '.salomeTools')
@@ -167,14 +167,14 @@ class ConfigManager:
         return over
 
     def get_config(self, application=None, options=None, command=None,
-                    dataDir=None):
+                    datadir=None):
         '''get the config from all the configuration files.
         
         :param application str: The application for which salomeTools is called.
         :param options class Options: The general salomeToos
                                       options (--overwrite or -l5, for example)
         :param command str: The command that is called.
-        :param dataDir str: The repository that contain 
+        :param datadir str: The repository that contain 
                             external data for salomeTools.
         :return: The final config.
         :rtype: class 'src.pyconf.Config'
@@ -189,7 +189,7 @@ class ConfigManager:
         # =====================================================================
         # create VARS section
         var = self._create_vars(application=application, command=command, 
-                                dataDir=dataDir)
+                                datadir=datadir)
         # add VARS to config
         cfg.VARS = src.pyconf.Mapping(cfg)
         for variable in var:
@@ -221,9 +221,9 @@ class ConfigManager:
         # =====================================================================
         # Load SITE config file
         # search only in the data directory
-        src.pyconf.streamOpener = ConfigOpener([cfg.VARS.dataDir])
+        src.pyconf.streamOpener = ConfigOpener([cfg.VARS.datadir])
         try:
-            site_cfg = src.pyconf.Config(open(os.path.join(cfg.VARS.dataDir, 
+            site_cfg = src.pyconf.Config(open(os.path.join(cfg.VARS.datadir, 
                                                            'site.pyconf')))
         except src.pyconf.ConfigError as e:
             raise src.SatException(_("Error in configuration file: "
@@ -279,7 +279,7 @@ class ConfigManager:
         # Load product config files in PRODUCTS section
        
         # The directory containing the softwares definition
-        products_dir = os.path.join(cfg.VARS.dataDir, 'products')
+        products_dir = os.path.join(cfg.VARS.datadir, 'products')
         
         # Loop on all files that are in softsDir directory
         # and read their config
@@ -349,7 +349,7 @@ class ConfigManager:
         user_cfg.addMapping('USER', src.pyconf.Mapping(user_cfg), "")
 
         #
-        user_cfg.USER.addMapping('workDir', os.path.expanduser('~'),
+        user_cfg.USER.addMapping('workdir', os.path.expanduser('~'),
             "This is where salomeTools will work. "
             "You may (and probably do) change it.\n")
         user_cfg.USER.addMapping('cvs_user', config.VARS.user,
index 3abe0f0addf26ca2cace015bbc1aa08e67492de8..c7e46020dcead744c65abd8460d3b66bca8baa2f 100644 (file)
@@ -138,8 +138,6 @@ def run(args, runner, logger):
     (options, args) = parser.parse_args(args)
 
     # get the log directory. 
-    # If there is an application, it is in cfg.APPLICATION.out_dir, 
-    # else in user directory
     logDir = runner.cfg.SITE.log.log_dir
 
     # If the clean options is invoked, 
index dc17baf1c76e2aa7b4cff4b432eb86b0bc5a726d..918d6171a5933d197c97c2a5288a5ac8f9eb26a6 100644 (file)
@@ -18,7 +18,7 @@ SITE :
     }
     log :
     {
-        log_dir : $USER.workDir + "/LOGS"
+        log_dir : $USER.workdir + "/LOGS"
     }
 }
 
index ba6d39f53ac769dee254c0cf22948848a834061d..3f431284e433f3d5c4b24d690ac136ffab67d666 100755 (executable)
@@ -83,11 +83,11 @@ parser.add_option('s', 'silent', 'boolean', 'silent',
 class Sat(object):
     '''The main class that stores all the commands of salomeTools
     '''
-    def __init__(self, opt='', dataDir=None):
+    def __init__(self, opt='', datadir=None):
         '''Initialization
         
         :param opt str: The sat options 
-        :param: dataDir str : the directory that contain all the external 
+        :param: datadir str : the directory that contain all the external 
                               data (like software pyconf and software scripts)
         '''
         # Read the salomeTools options (the list of possible options is 
@@ -103,7 +103,7 @@ class Sat(object):
         self.cfg = None # the config that will be read using pyconf module
         self.arguments = opt
         self.options = options # the options passed to salomeTools
-        self.dataDir = dataDir # default value will be <salomeTools root>/data
+        self.datadir = datadir # default value will be <salomeTools root>/data
         # set the commands by calling the dedicated function
         self._setCommands(cmdsdir)
         
@@ -161,7 +161,7 @@ class Sat(object):
                 
                 # read the configuration from all the pyconf files    
                 cfgManager = config.ConfigManager()
-                self.cfg = cfgManager.get_config(dataDir=self.dataDir, 
+                self.cfg = cfgManager.get_config(datadir=self.datadir, 
                                                  application=appliToLoad, 
                                                  options=self.options, 
                                                  command=__nameCmd__)
@@ -273,7 +273,7 @@ class Sat(object):
         command = opt[0]
         # read the configuration from all the pyconf files    
         cfgManager = config.ConfigManager()
-        self.cfg = cfgManager.get_config(dataDir=self.dataDir)
+        self.cfg = cfgManager.get_config(datadir=self.datadir)
 
         # Check if this command exists
         if not hasattr(self, command):
index 00d8e978ef96534a077897af5ac5b557c6303427..64c2c86002fc8d8d3009596ec06c78fbc329273d 100644 (file)
@@ -28,10 +28,7 @@ sys.path.append(os.path.join(testdir, '..', '_testTools'))
 sys.path.append(os.path.join(testdir, '..', '..','commands'))
 
 from salomeTools import Sat
-from tools import check_proc_existence_and_kill
-from tools import outRedirection
 import HTMLTestRunner
-import src.xmlManager
 
 sleep_time = 3