<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 8, 2014 at 4:29 AM, Hamish <span dir="ltr"><<a href="mailto:hamish.webmail@gmail.com" target="_blank">hamish.webmail@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="">Leo wrote:<br>
> > Cellsize : 118.28096836<br>
> > SECTION 1a (of 4): Initiating Memory.<br>
> > Current region rows: 17433, cols: 17539<br>
> > ERROR: G_malloc: unable to allocate 2448854040 bytes of memory at<br>
> > init_vars.c:134<br>
> > WARNING: Subprocess failed with exit code 1<br>
<br>
</div>Madi:<br>
<div class="">> This log suggests that r.watershed, called by r.hazard.flood, is not<br>
> able to finish the job due to lack of memory.<br>
<br>
</div>[@devs]<br>
in bash you can do a test "if [ $? -ne 0 ] ; then" to see if r.watershed<br>
finished correctly and go to a 'g.message -e' and 'exit 1' if it<br>
failed. r.hazard.flood is a python script, how to apply the same to<br>
grass.run_command() before claiming success and continuing?<br>
<br></blockquote><div>In case of run_command you should check the return value which is the exit code of the module.<br></div><div><br>ret = run_command('g.region', s=0, n=5, w=0, e=5, res=1)<br>if ret != 0:<br>    grass.script.fatal(_("g.region failed, see the error message above"))<br>

<br>It is actually designed to resemble the calls in shell which I don't think is a right think to do, so please see ticket #2326.<br><br>[doc] <a href="http://grass.osgeo.org/programming7/namespacepython_1_1script_1_1core.html#a0cbf4805e1691904c8245037ea359c71">http://grass.osgeo.org/programming7/namespacepython_1_1script_1_1core.html#a0cbf4805e1691904c8245037ea359c71</a> <br>

[src] <a href="http://trac.osgeo.org/grass/browser/grass/trunk/lib/python/script/core.py#L352">http://trac.osgeo.org/grass/browser/grass/trunk/lib/python/script/core.py#L352</a><br>[ticket] <a href="http://trac.osgeo.org/grass/ticket/2326">http://trac.osgeo.org/grass/ticket/2326</a><br>

</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
regards,<br>
<br>
--<br>
Hamish <<a href="mailto:hamish.webmail@gmail.com">hamish.webmail@gmail.com</a>><br>
.<br>
Thought I should join the Yahoo mail diaspora before 30 days<br>
worth of my emails got flushed from everyone's spam boxes never<br>
to be seen again. In the last weeks some have made it to the ML<br>
archives at least, if not to end recipients. Others seem to have<br>
just disappeared into /dev/null. It didn't help that the web<br>
interface had become an unusable gibberish of broken JavaScript<br>
and their IMAP would only transfer the oldest 4% of my inbox.<br>
.<br>
<a href="http://www.ietf.org/mail-archive/web/ietf/current/msg87153.html" target="_blank">http://www.ietf.org/mail-archive/web/ietf/current/msg87153.html</a><br>
<a href="http://www.spamresource.com/2014/04/up-in-arms-about-yahoos-dmarc-policy.html" target="_blank">http://www.spamresource.com/2014/04/up-in-arms-about-yahoos-dmarc-policy.html</a><br>
<a href="http://wiki.list.org/pages/viewpage.action?pageId=17891458" target="_blank">http://wiki.list.org/pages/viewpage.action?pageId=17891458</a><br>
_______________________________________________<br>
grass-user mailing list<br>
<a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
</blockquote></div><br></div></div>