[GRASS-dev] GRASS 7 scripts overhaul

Glynn Clements glynn at gclements.plus.com
Tue Sep 6 01:31:43 EDT 2011


Markus Metz wrote:

> > I have tested almost all GRASS 7 scripts and fixed a lot of them (mostly
> > broken in the parser part).
> >
> > To all relevant (most) I have added North Carolina examples for easier
> > testing.
> >
> > This set of modules I did not manage to fix:
> >
> [snip]
> >
> > * v.out.gps -t input=railroads output=trail.gpx
> > [nothing happens...]
> > ^CTraceback (most recent call last):
> >  File "/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/scripts/m.proj",
> > line 278, in <module>
> >    main()
> > Traceback (most recent call last):
> >  File "/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/scripts/v.out.gps",
> > line 316, in <module>
> >    main()
> >  File "/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/scripts/v.out.gps",
> > line 207, in main
> >    p2.stdin.write(line)
> > KeyboardInterrupt
> 
> I think the piping from p1 to p2 is broken because the scripts tries
> to sneak in between p1.stdout and p2.stdin and p2 is maybe getting
> confused.

It's m.proj which is broken:

    p = grass.Popen(cmd, stdin = grass.PIPE, stdout = grass.PIPE)

cs2cs' stdout is redirected to a pipe, but the script never reads it.

It needs:

--- scripts/m.proj/m.proj.py	(revision 48154)
+++ scripts/m.proj/m.proj.py	(working copy)
@@ -235,7 +235,7 @@
     #   cs2cs | sed -e 's/d/:/g' -e "s/'/:/g"  -e 's/"//g'
 
     cmd = ['cs2cs'] + copyinp + outfmt + in_proj.split() + ['+to'] + out_proj.split()
-    p = grass.Popen(cmd, stdin = grass.PIPE, stdout = grass.PIPE)
+    p = grass.Popen(cmd, stdin = grass.PIPE)
 
     while True:
 	line = inf.readline()

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


More information about the grass-dev mailing list