[GRASS-user] some issues with python scripts

Martin Landa landa.martin at gmail.com
Mon Jan 17 08:04:51 EST 2011


Hi,

2011/1/16 Carlos Grohmann <carlos.grohmann at gmail.com>:
> 1 - it seems that http://grass.osgeo.org/programming6/pythonlib.html is offline

I can see, it's back.

[...]

> 4 - error handling + user break
> In my bash scripts I have a few lines that deal with user break:
>
> #######################################################################
> # what to do in case of user break:
> exitprocedure()
> {
>  g.message -e 'User break!'
>  #delete any TMP files:
>  g.remove rast=$TMP1,$TMP2,$TMP3,$TMP4 > /dev/null
>
> }
> # shell check for user break (signal list: trap -l)
> trap "exitprocedure" 2 3 15
>
> what would be an equivalent for python?

I created a wiki page for these issue, feel free to improve...

http://grass.osgeo.org/wiki/Converting_Bash_scripts_to_Python

Martin

-- 
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa


More information about the grass-user mailing list