On Tue, Dec 2, 2014 at 5:09 PM, Glynn Clements <gl...@gclements.plus.com> wrote:
> Markus Neteler wrote: > > > The issue is this: > > > > GRASS 7.1.svn (nc_spm_08_grass7):~ > g.region rast=lsat7_2002_30 > > GRASS 7.1.svn (nc_spm_08_grass7):~ > d.correlate > map=lsat7_2002_30,lsat7_2002_40 > > ERROR: No graphics device selected. Use d.mon to select graphics device. > > Traceback (most recent call last): > > ... > > grass.exceptions.CalledModuleError: Module run None ['d.text', > > 'color=black', 'line=1', 'stdin=CORRELATION', 'size=4'] ended with > > error > > Process ended with non-zero return code 1. See errors in the (error) > output. > > I can't reproduce the problem. And I'm not even sure how d.text can > exit with a non-zero return code without printing any error message. I can reproduce it. Are you sure you don't have MONITOR or GRASS_RENDER_IMMEDIATE (or any other if it matters) set? I start GRASS session (without any special shell environment) and I get it. The error is the beginning, r.text is printed first (that's ERROR:... I think), then the error from the main process is printed (Traceback....). I think the solution is try-except or calling the function(s) with with secret `errors` parameter set to 'exit'. The later is usually not the ideal solution but it might be appropriate for some calls in d.* scripts. The issue is that with errors='exit' you cannot provide the user with failed module name, so then the context of the error message might be unclear.
_______________________________________________ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev