[GRASS-dev] Re: requiring 2.8.1.1???

Glynn Clements glynn at gclements.plus.com
Sun Jul 27 08:56:21 EDT 2008


Martin Landa wrote:

> > wxversion doesn't *check* for a particular version, it *chooses* a
> > particular version.
> >
> > If you use wxversion.select(), you only need to have that particular
> > version installed.
> >
> > OTOH, if you "import wx" without using wxversion.select(), then check
> > wx.version(), the desired version not only needs to be installed, it
> > also needs to be the default version (i.e. installed as "wx").
> >
> > So, if you have e.g. both 2.6 and 2.8, and "wx" is 2.6, the code will
> > fail without the use of wxversion.select().
> 
> AFAIU, that's CheckForWx() should do
> 
> http://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/gui_modules/globalvar.py#L27

Right.

BTW, you can use inequality operators on lists, so you can compare
hierarchical version numbers with e.g.:

	version = wx.version().split(' ')[0]
	if map(int,version.split('.')) < [2,8,1,1]:
		raise ...

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


More information about the grass-dev mailing list