[GRASS-user] script by bash to Python

Glynn Clements glynn at gclements.plus.com
Wed Sep 24 21:13:32 EDT 2008


Gabriele N. wrote:

> A step forward  :-)
> I think that the letters with the accent in the code create problems. I
> replaced the letters " è " with " e ' " and now the script v.to.dem.sh work.

Is the non-ASCII character embedded in the script, or is it being
translated via a message catalog? The embedded values should be
limited to ASCII; if you want localisation, add translations to the
message catalog.

[If you use the GRASS build system, the "script" target (from
Script.make) will extract the strings into the file
locale/scriptstrings/<script_name>_to_translate.c. From there, the
"pot" target in locale/Makefile will extract the strings when
generating the .pot files.]

For --interface-description, the value (translated or not) will be
copied verbatim into the XML output. The XML data is defined to use
the locale's encoding if langinfo.h was detected by configure, or
UTF-8 otherwise.

Needless to say, this requires that the string uses an encoding which
matches your locale. For translated strings, this should always be the
case, but for untranslated strings, anything which isn't ASCII will
fail if the locale's encoding doesn't match that used for the string.

> Still does not go well: give me an error message when I launch (picture
> attached) and does not work the STOP button........ but gives a result in
> output.

One possibility is that the script is returning a non-zero exit code,
which the GUI considers an error. If you don't have an explicit "exit"
statement at the end of the script, it will return the exit code from
the last command.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-user mailing list