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:
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
# 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:
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
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):
'''
# 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')
# 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:])