[GRASS-dev] [bug #5205] (grass) r.colors color=rules: few seconds delay between each warning

this bug's URL: http://intevation.de/rt/webrt?serial_num=5205
-------------------------------------------------------------------------

Subject: r.colors color=rules: few seconds delay between each warning

If one makes a mistake in rules, resuming from each warning takes few sec.

eg.

$ r.colors map color=rules
Data range is 0 to 5

[ENTER]

WARNING: bad color specification
[few seconds]
WARNING: rule is not added
[few seconds]

Maciek

-------------------------------------------- Managed by Request Tracker

Request Tracker wrote:

this bug's URL: http://intevation.de/rt/webrt?serial_num=5205
-------------------------------------------------------------------------

Subject: r.colors color=rules: few seconds delay between each warning

If one makes a mistake in rules, resuming from each warning takes few sec.

eg.

$ r.colors map color=rules
Data range is 0 to 5
> [ENTER]
WARNING: bad color specification
[few seconds]
WARNING: rule is not added
[few seconds]

The delay is built into lib/gis/error.c; it should be removed, IMHO.

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

> this bug's URL: http://intevation.de/rt/webrt?serial_num=5205
> -------------------------------------------------------------------
>
> Subject: r.colors color=rules: few seconds delay between each
> warning
>
> If one makes a mistake in rules, resuming from each warning takes
> few sec.
>
> eg.
>
> $ r.colors map color=rules
> Data range is 0 to 5
> > [ENTER]
> WARNING: bad color specification
> [few seconds]
> WARNING: rule is not added
> [few seconds]

The delay is built into lib/gis/error.c; it should be removed, IMHO.

the delay is there for interactive modules which clear the screen; if
there is no delay there is no chance to see the warning before the
terminal blanks and know that something is wrong.

these modules call:
  G_sleep_on_error(1);

the default is:
  G_sleep_on_error(0);

the problem with r.colors is that raster/r.colors/main.c explicitly
calls G_sleep_on_error(1);

Hamish

Hamish wrote:

> > this bug's URL: http://intevation.de/rt/webrt?serial_num=5205
> > -------------------------------------------------------------------
> >
> > Subject: r.colors color=rules: few seconds delay between each
> > warning
> >
> > If one makes a mistake in rules, resuming from each warning takes
> > few sec.
> >
> > eg.
> >
> > $ r.colors map color=rules
> > Data range is 0 to 5
> > > [ENTER]
> > WARNING: bad color specification
> > [few seconds]
> > WARNING: rule is not added
> > [few seconds]
>
> The delay is built into lib/gis/error.c; it should be removed, IMHO.

the delay is there for interactive modules which clear the screen; if
there is no delay there is no chance to see the warning before the
terminal blanks and know that something is wrong.

these modules call:
  G_sleep_on_error(1);

the default is:
  G_sleep_on_error(0);

the problem with r.colors is that raster/r.colors/main.c explicitly
calls G_sleep_on_error(1);

I have removed the G_sleep_on_error() calls.

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