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

Michael Barton michael.barton at asu.edu
Sat Jul 26 21:39:25 EDT 2008


On Jul 26, 2008, at 4:07 PM, Glynn Clements wrote:

>
> Michael Barton wrote:
>
>>> Just try in python
>>>
>>>>>> import wxversion
>>>>>> wxversion.select(str(2.8))
>>>>>> import wx
>>>>>> wx.__version__
>>> '2.8.8.1'
>>
>> This version check is failing with 2.8.8.0 on the Mac even if the
>> correct version is installed. It may be failing with other version
>> too.  wx.__version__ looks for wxpython SOURCE (*.py) files that are
>> not currently being included in the wxpython binary installer for  
>> some
>> reason. The object files are correct and being installed (*.pyo).
>>
>> Why not just use wx.version()? It gives the correct response
>> regardless of whether the source files are installed or not.
>
> 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().

Maybe I misunderstand, but this is what we want. We need to know that  
the default version of wx is at or above 2.8.1. So it doesn't matter  
if you have 2.6 and 2.8.1, if 2.6 is your default,

import wx
wx.version()

should say that 2.6 is running, which is the wrong version. This  
should generate an error out of CheckForWx().

Michael


More information about the grass-dev mailing list