for name in names:
# display information
- len_points = max_len - len(name)
+ len_points = max_len - len(name) + 3
local_path, archive_path = d_content[name]
in_archive = os.path.join(name_archive, archive_path)
logger.write(name + " " + len_points * "." + " "+ in_archive + " ", 3)
bin_kernel_install_dir = os.path.join(kernel_root_dir,"bin","salome")
# check if the application contains an application module
- l_product_info = src.product.get_products_infos(config.APPLICATION.products.keys(),
- config)
+ l_product_info = src.product.get_products_infos(config.APPLICATION.products.keys(), config)
salome_application_name="Not defined"
for prod_name, prod_info in l_product_info:
# look for a salome application
runner.cfg.VARS.application), 1)
# Get the default directory where to put the packages
- package_default_path = os.path.join(runner.cfg.APPLICATION.workdir,
- "PACKAGE")
+ package_default_path = os.path.join(runner.cfg.APPLICATION.workdir, "PACKAGE")
src.ensure_path_exists(package_default_path)
# if the package contains a project:
break
if foundProject is None:
- local_path = os.path.join(runner.cfg.VARS.salometoolsway,
- "data",
- "local.pyconf")
+ local_path = os.path.join(runner.cfg.VARS.salometoolsway, "data", "local.pyconf")
msg = _("""ERROR: the project %(1)s is not visible by salomeTools.
known projects are:
%(2)s
d_files_to_add[file_name] = (file_path, file_name)
logger.write("\n", 2)
-
logger.write(src.printcolors.printcLabel(_("Actually do the package")), 2)
logger.write("\n", 2)
+ logger.write("\nfiles and directories to add:\n%s\n\n" % PP.pformat(d_files_to_add), 5)
res = 0
try:
logger.write(_("\n"), 1)
return 1
+ # case if no application, only package sat as 'sat package -t'
+ try:
+ app = runner.cfg.APPLICATION
+ except:
+ app = None
+
# unconditionaly remove the tmp_local_working_dir
- tmp_local_working_dir = os.path.join(runner.cfg.APPLICATION.workdir, "tmp_package")
- if os.path.isdir(tmp_local_working_dir):
- shutil.rmtree(tmp_local_working_dir)
+ if app is not None:
+ tmp_local_working_dir = os.path.join(app.workdir, "tmp_package")
+ if os.path.isdir(tmp_local_working_dir):
+ shutil.rmtree(tmp_local_working_dir)
# have to decide some time
DBG.tofix("make shutil.rmtree('%s') effective" % tmp_working_dir, "", DBG.isDeveloper())
def __getitem__(self, key):
data = object.__getattribute__(self, 'data')
if key not in data:
- raise AttributeError(key)
+ raise AttributeError("Unknown pyconf key: '%s'" % key)
rv = data[key]
return self.evaluate(rv)
try:
rv = data[index]
except (IndexError, KeyError, TypeError):
- raise ConfigResolutionError('%r is not a valid index for %r' % (index, object.__getattribute__(self, 'path')))
+ raise ConfigResolutionError('Invalid pyconf index %r for %r' % (index, object.__getattribute__(self, 'path')))
if not isinstance(rv, list):
rv = self.evaluate(rv)
else:
except Exception as e:
# Get error
logger_command.write("\n***** ", 1)
- logger_command.write(src.printcolors.printcError(
- "salomeTools ERROR:"), 1)
+ logger_command.write(src.printcolors.printcError( "salomeTools ERROR: sat %s" % __nameCmd__), 1)
logger_command.write("\n" + str(e) + "\n\n", 1)
# get stack
__, __, exc_traceback = sys.exc_info()
verbosity = 5
if self.options.debug_mode:
verbosity = 1
- logger_command.write("TRACEBACK: %s" % stack.replace('"',"'"),
- verbosity)
+ logger_command.write("TRACEBACK: %s" % stack.replace('"',"'"), verbosity)
finally:
# set res if it is not set in the command
if res is None: