[GRASS-dev] wxversion checking does not work with bundled wxpython

William Kyngesburye woklist at kyngchaos.com
Sun Mar 8 21:05:29 EDT 2009


I was looking into the possibility of bundling a slimmed-down wxpython  
into the OSX application package and ran into a problem.  It appears  
that wxversion.select() does not work with a bundled wxpython.  From  
the wxversion docstring:

   NOTE: If you are making a 'bundle' of your application with a tool
   like py2exe then you should *not* use the wxversion module since it
   looks at the filesystem for the directories on sys.path, it will fail
   in a bundled environment.  Instead you should simply ensure that the
   version of wxPython that you want is found by default on the sys.path
   when making the bundled version by setting PYTHONPATH.  Then that
   version will be included in your bundle and your app will work as
   expected.

I suggest changing the CheckForWx() line in globalvar.py, and a bunch  
of others, to:

if not os.getenv("GRASS_WXBUNDLED"):
     CheckForWx()

Then I can set PYTHONPATH and GRASS_WXBUNDLED and the wx gui will use  
the bundled wxpython.  (tested and it works)

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"We are at war with them. Neither in hatred nor revenge and with no  
particular pleasure I shall kill every ___ I can until the war is  
over. That is my duty."

"Don't you even hate 'em?"

"What good would it do if I did? If all the many millions of people of  
the allied nations devoted an entire year exclusively to hating the  
____ it wouldn't kill one ___ nor shorten the war one day."

<Ha, ha> "And it might give 'em all stomach ulcers."

- Tarzan, on war



More information about the grass-dev mailing list