[GRASS-dev] Suggestion: wxGUI as default in G6.4

Glynn Clements glynn at gclements.plus.com
Fri Feb 26 15:33:19 EST 2010


Markus Neteler wrote:

> > My main concern is that there should be some way to prevent the GUI
> > from loading the vdigit and nviz modules.
> 
> I agree. Is that hard to accomplish?
> 
> My brute-force method is (in GRASS):
> 
> rm -rf $GISBASE/etc/wxpython/nviz $GISBASE/etc/wxpython/vdigit
> 
> then 'g.gui wxpython' works.

In 6.4 and 6.5, you can just omit --with-wxwidgets; that will disable
the vdigit and nviz modules (the main GUI is installed regardless).

In 7.0, it will also disable xganim and wximgview.

> > AFAIK, it handles the case where these modules don't exist. But if
> > they do exist and there's something wrong with them (binary
> > compatibility issues), the whole GUI is toast.
> 
> ... which is unacceptable and currently the case on my laptop.
> So a functionality test (or whatever) before loading  the vdigit and
> nviz modules would be needed.

This would need to be a separate program. If you "import vdigit" (or
nviz), failure typically means that the program performing the import
crashes; it cannot be trapped.

It would be simpler to conditionalise the import on an environment
variable.

But the only long-term solution is to remove those modules from the
GUI and make vdigit and nviz separate programs. The main GUI shouldn't
be importing any binary module which isn't part of either Python
itself or of a well-tested, mainstream package (e.g. wxPython, NumPy),
and definitely shouldn't be importing anything linked against GRASS
libraries (with G_fatal_error() and memory leaks and innumerable
static variables).

I keep meaning to do this (the "remove" part) for 7.0, but I always
end up getting lost in the code and giving up.

On a related note: it would really help if wxGUI authors would add
paramter type information to methods, i.e.:

	assert isinstance(arg1, str)
	assert isinstance(arg2, (int,long,float))

etc. Without type information, it's extremely difficult to get a
handle on what the code is supposed to be doing, or where to look for
the code behind e.g. "arg1.foo()".

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


More information about the grass-dev mailing list