<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 14, 2014 at 9:47 AM, Anna Petrášová <span dir="ltr"><<a href="mailto:kratochanna@gmail.com" target="_blank">kratochanna@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Fri, Nov 14, 2014 at 6:37 AM, Moritz Lennert <span dir="ltr"><<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div>On 14/11/14 10:25, Helmut Kudrnovsky wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Anna Petrášová wrote<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
but in --quiet mode it fails with:<br>
<br>
v.fixed.segmentpoints --quiet vector=iselflipped@myricaria cat=1<br>
dir=C:\tmp\grassscript distance=25000<br>
Traceback (most recent call last):<br>
   File "C:\Users\myricaria\AppData\<u></u>Roaming\GRASS7\addons/scr<br>
ipts/<a href="http://v.fixed.segmentpoints.py" target="_blank">v.fixed.segmentpoints.py</a>"<u></u>, line 226, in<br>
</blockquote>
<module><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
     sys.exit(main())<br>
   File "C:\Users\myricaria\AppData\<u></u>Roaming\GRASS7\addons/scr<br>
ipts/<a href="http://v.fixed.segmentpoints.py" target="_blank">v.fixed.segmentpoints.py</a>"<u></u>, line 100, in main<br>
     vector_line_length =<br>
float(tmp.split('\n')[1].<u></u>split('|')[1])<br>
IndexError: list index out of range<br>
(Thu Nov 13 21:40:08 2014) Befehl ausgeführt (2 Sek)<br>
<br>
any idea?<br>
<br>
</blockquote>
<br>
Could you try to print tmp with and without quiet?<br>
</blockquote>
<br>
<a href="http://trac.osgeo.org/grass/browser/grass-addons/grass7/vector/v.fixed.segmentpoints/v.fixed.segmentpoints.py#L102" target="_blank">http://trac.osgeo.org/grass/<u></u>browser/grass-addons/grass7/<u></u>vector/v.fixed.segmentpoints/<u></u>v.fixed.segmentpoints.py#L102</a><br>
<br>
102         # Read length<br>
103         tmp = grass.read_command('v.to.db', map = voutline,<br>
104                                          type = 'line',<br>
105                                          layer = 1,<br>
106                                          qlayer = 1,<br>
107                                          option = 'length',<br>
108                                          units = 'meters',<br>
109                                          column = 'vlength',<br>
110                                          flags = 'p')<br>
111         vector_line_length = float(tmp.split('\n')[1].<u></u>split('|')[1])<br>
112     <br>
113         # Print vector line length<br>
114         grass.message( "Vector line length in meter:" )<br>
115         grass.message( vector_line_length )<br>
116         grass.message( "----" )<br>
<br>
it's just to get the length of the vector line for further calculations:<br>
<br>
in normal and verbose mode:<br>
<br>
----<br>
Lese Objekte...<br>
Vector line length in meter:<br>
58858.3366368<br>
----<br>
<br>
as Moritz points out, it seems quiet mode suppresses the access to the<br>
output of grass.read_command; his solution/workaround with GRASS_VERBOSE env<br>
variable seems not to work here on my side.<br>
<br>
</blockquote>
<br></div></div>
I'm afraid that --quiet supersedes any settings in the code, but am not sure.</blockquote><div><br></div></div></div><div>So how about  setting quiet=False when calling v.to.db? Anyway I don't think quiet causes read_command to be completely silent, just run </div><div><br></div><div>grass.read_command('<a href="http://r.info" target="_blank">r.info</a>', map='elevation', flags='g', quiet=True)<br></div><div><br></div><div>and it gives output as expected.</div></div></div></div></blockquote><div><br></div><div>It's because of the header line:</div><div>cat|length</div><div>1|572.767146965659<br></div><div><br></div><div>but in quiet mode you get:</div><div><br></div><div><div>1|572.767146965659</div></div><div><br></div><div>so I would suggest set quiet=True for v.to.db and change the code for parsing to expect just one line.</div><div><br></div><div>Anna</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span><font color="#888888"><br>
<br>
Moritz</font></span><div><div><br>
______________________________<u></u>_________________<br>
grass-dev mailing list<br>
<a href="mailto:grass-dev@lists.osgeo.org" target="_blank">grass-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-dev" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/grass-dev</a></div></div></blockquote></span></div><br></div></div>
</blockquote></div><br></div></div>