products = options.products
for p in products:
if p not in cfg.APPLICATION.products:
- raise src.SatException(_("Product %(product)s "
- "not defined in application %(application)s") %
- { 'product': p, 'application': cfg.VARS.application} )
+ msg = _("Product %(1)s not defined in application %(2)s") %
+ { '1': p, '2': cfg.VARS.application}
+ raise src.SatException(msg)
# Construct the list of tuple containing
# the products name and their definition
command = src.get_cfg_param(p_info, "test_build", "Not found")
if command == "Not found":
cmd_found = False
- msg = _('''\
+ msg = _("""\
WARNING: The product %(name)s is defined as having tests.
- But it is compiled using a script and the key "test_build"
- is not defined in the definition of %(name)''') % {"name": p_name}
+ But it is compiled using a script and the key 'test_build'
+ is not defined in the definition of %(name)""") % {"name": p_name}
logger.write("%s\n" % msg, 4)
if ignored or not cmd_found:
'''
for path in l_paths:
if not path.isdir():
- msg = _("Warning: the path %s does not "
+ msg = _("WARNING: the path %s does not "
"exists (or is not a directory)\n" % path.__str__())
logger.write(src.printcolors.printcWarning(msg), 1)
else:
# Suppress the list of paths
suppress_directories(l_dir_to_suppress, logger)
- return 0
\ No newline at end of file
+ return 0
# Check that there are no singletons in the result (it would be a bug)
for elem in dic_fic_paths:
if len(dic_fic_paths[elem])<2:
- logger.write(_("Warning : element %s has not more than"
- " two paths.\n") % elem, 3)
+ logger.write(
+ _("WARNING : element %s has not more than two paths.\n") % elem,
+ 3 )
# Display the results
'''
if self._connection_successful == None:
message = _("""\
-Warning : trying to ask if the connection to
+WARNING : trying to ask if the connection to
(name: %(1)s host: %(2)s, port: %(3)s, user: %(4)s) is OK
whereas there were no connection request""" %
{"1": self.name, "2": self.host, "3": self.port, "4": self.user} )
# Prevent multiple run
if self.has_begun():
- msg = _("Warning: A job can only be launched one time")
+ msg = _("WARNING: A job can only be launched one time")
msg2 = _("Trying to launch the job \"%s\" whereas it has "
"already been launched." % self.name)
self.logger.write(src.printcolors.printcWarning("%s\n%s\n" % (msg,
for job_def in self.cfg_jobs.jobs :
if not "machine" in job_def:
- msg = _('WARNING: The job "%s" do not have the key '
- '"machine", this job is ignored.\n\n' % job_def.name)
+ msg = _("""\
+WARNING: The job '%s' do not have the key 'machine'.
+ This job is ignored.\n""") % job_def.name
self.logger.write(src.printcolors.printcWarning(msg))
continue
name_machine = job_def.machine
host_list.append((host, port))
if a_machine == None:
- msg = _("WARNING: The job \"%(job_name)s\" requires the "
- "machine \"%(machine_name)s\" but this machine "
- "is not defined in the configuration file.\n"
- "The job will not be launched\n")
- self.logger.write(src.printcolors.printcWarning(
- msg % {"job_name" : job_def.name,
- "machine_name" : name_machine}))
+ msg = _("""\
+WARNING: The job '%(job)s' requires the machine '%(machine)s'.
+ This machine is not defined in the configuration file.
+ The job will not be launched.
+""") % {"job" : job_def.name, "machine" : name_machine}
+ self.logger.write(src.printcolors.printcWarning(msg))
continue
a_job = self.define_job(job_def, a_machine)
"Establishing connection with all the machines :\n")))
for machine in self.lmachines:
# little algorithm in order to display traces
- begin_line = (_("Connection to %s: " % machine.name))
+ begin_line = (_("Connection to %s: ") % machine.name)
if pad - len(begin_line) < 0:
endline = " "
else:
(begin_line,
endline,
src.printcolors.printc(src.KO_STATUS),
- _("Copy of SAT failed: %s" % res_copy)), 3)
+ _("Copy of SAT failed: %s") % res_copy), 3)
else:
self.logger.write('\r%s' %
((len(begin_line)+len(endline)+20) * " "), 3)
global_xml = src.xmlManager.ReadXmlFile(file_path)
l_globalxml.append(global_xml)
except Exception as e:
- msg = _("\nWarning: the file '%(1)s' can not be read, it will be "
- "ignored\n%(2)s" % {"1": file_path, "2": e})
+ msg = _("WARNING: the file '%(1)s' can not be read, it will be "
+ "ignored\n%(2)s") % {"1": file_path, "2": e}
self.logger.write("%s\n" % src.printcolors.printcWarning(
msg), 5)
try:
jb.kill_remote_process()
except Exception as e:
- msg = _("Failed to kill job %(1)s: %(2)s\n" % {"1": jb.name, "2": e})
+ msg = _("Failed to kill job %(1)s: %(2)s\n") % {"1": jb.name, "2": e}
logger.write(src.printcolors.printcWarning(msg))
if jb.res_job != "0":
res = 1
prefix = os.path.join( options.prefix, name )
if os.path.exists( prefix ) :
if not options.force :
- raise src.SatException( _("The path %s already exists, use option"
- " --force to remove it." %prefix ) )
+ raise src.SatException(
+ _("The path %s already exists, use option --force to remove it.") % prefix )
else :
shutil.rmtree( prefix )
#Save previous version
pyconf = config.VARS.product + '.pyconf'
pyconfBackup = config.VARS.product + '-backup.pyconf'
- logger.write(_("Updating %(new)s (previous version saved "
- "as %(old)s).") % { "new": pyconf, "old": pyconfBackup }, 3)
+ logger.write(
+ _("Updating %(new)s (previous version saved as %(old)s)." ) %
+ { "new": pyconf, "old": pyconfBackup }, 3)
path = config.getPath( pyconf )
shutil.copyfile( os.path.join( path, pyconf ),
os.path.join( path, pyconfBackup ) )
if launcher_name not in os.listdir(launcher_dir):
message = _("""\
The launcher %(1)s was not found in directory '%(2)s'.
-Did you run the command 'sat launcher' ?\n""" % {"1": launcher_name, "2": launcher_dir} )
+Did you run the command 'sat launcher' ?\n""") % {"1": launcher_name, "2": launcher_dir}
raise src.SatException(message)
launcher_path = os.path.join(launcher_dir, launcher_name)
if not os.path.exists(launcher_path):
message = _("""\
The launcher at path '%s' is missing.
-Did you run the command 'sat launcher' ?\n""" % launcher_path )
+Did you run the command 'sat launcher' ?\n""") % launcher_path
raise src.SatException(message)
# Determine the command to launch (add the additional arguments)
return ask_a_path()
elif os.path.exists(path):
- result = raw_input("Warning, the content of %s will be deleted. Are you"
+ result = raw_input("WARNING: the content of %s will be deleted. Are you"
" sure to continue ? [y/n] " % path)
if result == "y":
return path
runner.cfg.VARS.application), 1)
with_application = True
elif not options.base:
- raise src.SatException(_('A test base is required. Use the --base '
- 'option'))
+ raise src.SatException(
+ _('A test base is required. Use the --base option') )
# the launcher is specified either by the application, or by the --launcher option
if with_application:
# check if environment is loaded
if 'KERNEL_ROOT_DIR' in os.environ:
- logger.write(src.printcolors.printcWarning(_("WARNING: "
- "SALOME environment already sourced")) + "\n", 1)
+ logger.write( src.printcolors.printcWarning(
+ _("WARNING: SALOME environment already sourced")) + "\n", 1 )
elif options.launcher:
- logger.write(src.printcolors.printcWarning(_("Running SALOME "
- "application.")) + "\n\n", 1)
+ logger.write(src.printcolors.printcWarning(
+ _("Running SALOME application.")) + "\n\n", 1)
else:
msg = _("Impossible to find any launcher.\nPlease specify an "
"application or a launcher")
poFile=$I18HOME/fr/LC_MESSAGES/salomeTools.po
refFile=$I18HOME/fr/LC_MESSAGES/ref.pot
-xgettext $SRC_DIR/*.py $SRC_DIR/commands/*.py $SRC_DIR/src/*.py \
- --no-wrap --no-location --language=Python --omit-header \
- --output=$refFile
-
-msgmerge --quiet --update $poFile $refFile
+xgettext $SRC_DIR/src/i18n/*.py \
+ $SRC_DIR/*.py \
+ $SRC_DIR/commands/*.py \
+ $SRC_DIR/src/*.py \
+ --no-wrap \
+ --no-location \
+ --language=Python \
+ --omit-header \
+ --output=$refFile
+
+msgmerge --quiet --update --previous $poFile $refFile
#retirer les messages obsolètes « #~ »
#msgattrib --no-obsolete -o $poFile $poFile
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-# test accentué
+#, python-format
msgid "Georges says '%(1)s' for %(2)s."
msgstr "pour %(2)s Hervé dit '%(1)s'."
msgstr ""
#, python-format
-msgid "Product %(product)s not defined in application %(application)s"
+msgid "Product %(1)s not defined in application %(2)s"
msgstr ""
#, python-format
msgid ""
"WARNING: The product %(name)s is defined as having tests.\n"
-" But it is compiled using a script and the key \"test_build\"\n"
-" is not defined in the definition of %(name)"
+" But it is compiled using a script and the key 'test_build'\n"
+" is not defined in the definition of %(name)"
msgstr ""
msgid ""
msgstr ""
#, python-format
-msgid "Warning: the path %s does not exists (or is not a directory)\n"
+msgid "Product %(product)s not defined in application %(application)s"
+msgstr ""
+
+#, python-format
+msgid "WARNING: the path %s does not exists (or is not a directory)\n"
msgstr ""
#, python-format
msgstr ""
#, python-format
-msgid "Warning : element %s has not more than two paths.\n"
+msgid "WARNING : element %s has not more than two paths.\n"
msgstr ""
msgid ""
#, python-format
msgid ""
-"Warning : trying to ask if the connection to \n"
+"WARNING : trying to ask if the connection to \n"
" (name: %(1)s host: %(2)s, port: %(3)s, user: %(4)s) is OK\n"
" whereas there were no connection request"
msgstr ""
"%s\n"
msgstr ""
-msgid "Warning: A job can only be launched one time"
+msgid "WARNING: A job can only be launched one time"
msgstr ""
#, python-format
#, python-format
msgid ""
-"WARNING: The job \"%s\" do not have the key \"machine\", this job is "
-"ignored.\n"
-"\n"
+"WARNING: The job '%s' do not have the key 'machine'.\n"
+" This job is ignored.\n"
msgstr ""
#, python-format
msgid ""
-"WARNING: The job \"%(job_name)s\" requires the machine \"%(machine_name)s\" "
-"but this machine is not defined in the configuration file.\n"
-"The job will not be launched\n"
+"WARNING: The job '%(job)s' requires the machine '%(machine)s'.\n"
+" This machine is not defined in the configuration file.\n"
+" The job will not be launched.\n"
msgstr ""
#, python-format
#, python-format
msgid ""
-"\n"
-"Warning: the file '%(1)s' can not be read, it will be ignored\n"
+"WARNING: the file '%(1)s' can not be read, it will be ignored\n"
"%(2)s"
msgstr ""
msgstr ""
#, python-format
-msgid "########## ERROR: test base '%s' not found\n"
+msgid "ERROR: test base '%s' not found\n"
msgstr ""
#, python-format
prod_info.get_source = "native"
elif prod_info.get_source == "native":
msg = _("The product %(prod)s has version %(ver)s but is "
- "declared as native in its definition" %
- { 'prod': prod_info.name, 'ver': version})
+ "declared as native in its definition") %
+ {'prod': prod_info.name, 'ver': version}
raise src.SatException(msg)
# If there is no definition but the product is declared as native,
if not prod_pyconf_path:
msg = _("""\
No definition found for the product %(1)s.
-Please create a %(2)s.pyconf file.""" % {"1": product_name, "2": product_name})
+Please create a %(2)s.pyconf file.""") % {"1": product_name, "2": product_name}
else:
msg = _("""\
No definition corresponding to the version %(1)s
was found in the file %(2)s.
-Please add a section in it.""" % {"1" : vv, "2" : prod_pyconf_path} )
+Please add a section in it.""") % {"1" : vv, "2" : prod_pyconf_path}
raise src.SatException(msg)
# Set the debug, dev and version keys
arch_path = src.find_file_in_lpath(arch_name,
config.PATHS.ARCHIVEPATH)
if not arch_path:
- msg = _("Archive %(1)s for %(2)s not found.\n" %
- {"1" : arch_name, "2" : prod_info.name})
+ msg = _("Archive %(1)s for %(2)s not found.\n") %
+ {"1" : arch_name, "2" : prod_info.name}
raise src.SatException(msg)
prod_info.archive_info.archive_name = arch_path
else:
arch_name,
config.PATHS.ARCHIVEPATH)
if not arch_path:
- msg = _("Archive %(1)s for %(2)s not found:\n" %
- {"1" : arch_name, "2" : prod_info.name})
+ msg = _("Archive %(1)s for %(2)s not found:\n") %
+ {"1" : arch_name, "2" : prod_info.name}
raise src.SatException(msg)
prod_info.archive_info.archive_name = arch_path
if "compil_script" not in prod_info:
msg = _("""\
No compilation script found for the product %s.
-Please provide a 'compil_script' key in its definition.""" % (product_name))
+Please provide a 'compil_script' key in its definition.""") % product_name
raise src.SatException(msg)
# Get the path of the script
config.PATHS.PRODUCTPATH,
"patches")
if not patch_path:
- msg = _("Patch %(1)s for %(2)s not found:\n" %
- {"1" : patch, "2" : prod_info.name})
+ msg = _("Patch %(1)s for %(2)s not found:\n") %
+ {"1" : patch, "2" : prod_info.name}
raise src.SatException(msg)
patches.append(patch_path)
prod_info.patches = patches
config.PATHS.PRODUCTPATH,
"env_scripts")
if not env_script_path:
- msg = _("Environment script %(1)s for %(2)s not found.\n" %
- {"1" : env_script_path, "2" : prod_info.name})
+ msg = _("Environment script %(1)s for %(2)s not found.\n") %
+ {"1" : env_script_path, "2" : prod_info.name}
raise src.SatException(msg)
prod_info.environ.env_script = env_script_path
symlinks=True)
def prepare_testbase_from_dir(self, testbase_name, testbase_dir):
- self.logger.write(_("get test base from dir: %s\n") % \
+ self.logger.write(_("get test base from dir: %s\n") %
src.printcolors.printcLabel(testbase_dir), 3)
if not os.access(testbase_dir, os.X_OK):
- raise src.SatException(_("testbase %(name)s (%(dir)s) does not "
- "exist ...\n") % { 'name': testbase_name,
- 'dir': testbase_dir })
+ raise src.SatException(
+ _("testbase %(name)s (%(dir)s) does not exist ...\n") %
+ { 'name': testbase_name, 'dir': testbase_dir } )
self._copy_dir(testbase_dir,
os.path.join(self.tmp_working_dir, 'BASES', testbase_name))
testbase_base,
testbase_tag):
self.logger.write(
- _("get test base '%(testbase)s' with '%(tag)s' tag from git\n") % {
- "testbase" : src.printcolors.printcLabel(testbase_name),
- "tag" : src.printcolors.printcLabel(testbase_tag)},
- 3)
+ _("get test base '%(testbase)s' with '%(tag)s' tag from git\n") %
+ { "testbase" : src.printcolors.printcLabel(testbase_name),
+ "tag" : src.printcolors.printcLabel(testbase_tag) },
+ 3)
try:
def set_signal(): # pragma: no cover
"""see http://bugs.python.org/issue1652"""
sys.exit(0)
def prepare_testbase_from_svn(self, user, testbase_name, testbase_base):
- self.logger.write(_("get test base '%s' from svn\n") % \
+ self.logger.write(_("get test base '%s' from svn\n") %
src.printcolors.printcLabel(testbase_name), 3)
try:
def set_signal(): # pragma: no cover
env=env_appli.environ.environ,)
if res != 0:
- raise src.SatException(_("Error: unable to get test base '%(nam"
- "e)s' from svn '%(repo)s'.") % \
- { 'name': testbase_name,
- 'repo': testbase_base })
+ raise src.SatException(
+ _("Error: unable to get test base '%(name)s' from svn '%(repo)s'.") %
+ { 'name': testbase_name, 'repo': testbase_base } )
except OSError:
self.logger.error(_("svn is not installed. exiting...\n"))
return 0
if not test_base_info:
- message = (_("########## ERROR: test base '%s' not found\n") %
- test_base_name)
+ message = (_("ERROR: test base '%s' not found\n") % test_base_name)
self.logger.write("%s\n" % src.printcolors.printcError(message))
return 1
test_base_name,
test_base_info.info.base)
else:
- raise src.SatException(_("unknown source type '%(type)s' for test b"
- "ase '%(base)s' ...\n") % {
- 'type': test_base_info.get_sources,
- 'base': test_base_name })
+ raise src.SatException(
+ _("unknown source type '%(type)s' for test base '%(base)s' ...\n") %
+ {'type': test_base_info.get_sources, 'base': test_base_name } )
self.currentTestBase = test_base_name
res_count = "%d / %d" % (self.nb_succeed,
self.nb_run - self.nb_acknoledge)
- res_out = _("Tests Results: %(succeed)d / %(total)d\n") % \
- { 'succeed': self.nb_succeed, 'total': self.nb_run }
+ res_out = _("Tests Results: %(succeed)d / %(total)d\n") %
+ { 'succeed': self.nb_succeed, 'total': self.nb_run }
if self.nb_succeed == self.nb_run:
res_out = src.printcolors.printcSuccess(res_out)
else: