[GRASS5] fixed 2 bugs in GIS Manager GRASS 6
Glynn Clements
glynn at gclements.plus.com
Thu Feb 17 21:34:24 EST 2005
Hamish wrote:
> > I think that Paul is on the right track, but there may be more to it
> > than just the author citation.
>
> Output needs to wait until G_parser() has been called.
Yep. When the --ui switch is provided, nothing must be written to
stdout except the Tcl/Tk code which generates the UI.
> I don't think it's the menu's fault (but I guess it should be called
> with the "execute" command like everything else unless there is a reason
> not to do so). Either G_parser() needs to be more robust at handling
> unexepected input or we must be strict about putting nothing unexpected
> before the G_parser() call in each module.
The latter. For --ui to work correctly, it's essential that the
program doesn't dump garbage into the Tcl/Tk code which --ui
generates.
Ditto for --html-description.
Modules *must* allow for these cases. You cannot assume that the
program is being executed "normally" until G_parser() has returned.
Modules shouldn't be calling anything except G_gisinit() and the
parser-initialisation stuff until G_parser() has returned. That
includes not connecting to monitors or databases, not accessing
$GISRC, nor the region, nor the mapset.
Yes, this means that you can't set "dynamic" defaults based upon any
of those factors. Tough; live with it. If you want dynamic defaults,
figure out the actual values *after* G_parser() returns.
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list