On Sun, Sep 9, 2018 at 10:13 PM Vaclav Petras <[email protected]> wrote: > On Sun, Sep 9, 2018 at 3:37 PM Markus Metz <[email protected]> > wrote: > > On Sun, Sep 9, 2018 at 4:46 PM Markus Neteler <[email protected]> wrote: > > > > > > > > I'd also like to see a way to print through the parser, i.e. a > > > functionality similiar to "sh -x shellscript" which prints every step. > > > Is that possible?
> It is not clear to me either what you are asking for. Do you want every > Python line? Python can do that with module `trace` (python -m trace --trace). > Here is an example (just for testing purposes, using the --tmp-location and > --exec): > > grass --tmp-location XY --exec python -m trace --trace `grass --tmp-location > XY --exec which r.mask` -r Good to know. Yet that's not what I meant - it also shows all the subcalls etc. > That gives little too much information, so perhaps: > > FILE="`./bin.x86_64-pc-linux-gnu/grass77 --tmp-location XY --exec which > r.mask`" > grass --tmp-location XY --exec python -m trace --trace $FILE -r | grep > `basename $FILE` > > Or do you want GRASS parser to print every module being executed? Yes, just the sequence of commands along with the parameter/flags used. Like "shell history" style. This would help for a quick orientation in long Python scripts with functions etc. Markus _______________________________________________ grass-dev mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/grass-dev
