Changeset 32338
- Timestamp:
- Jul 27, 2008, 10:09:08 AM (16 years ago)
- File:
-
- 1 edited
-
grass/trunk/gui/wxpython/gui_modules/globalvar.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
grass/trunk/gui/wxpython/gui_modules/globalvar.py
r32328 r32338 1 1 """ 2 MODULE:global.py2 @package global.py 3 3 4 PURPOSE:Global variables4 @brief Global variables 5 5 6 This module provide the space for global variables7 used in the code.6 This module provide the space for global variables 7 used in the code. 8 8 9 AUTHOR(S): GRASS Development Team 10 Martin Landa <landa.martin gmail.com> 9 (C) 2007 by the GRASS Development Team 11 10 12 COPYRIGHT: (C) 2007 by the GRASS Development Team 11 This program is free software under the GNU General Public 12 License (>=v2). Read the file COPYING that comes with GRASS 13 for details. 13 14 14 This program is free software under the GNU General Public 15 License (>=v2). Read the file COPYING that comes with GRASS 16 for details. 15 @author Martin Landa <landa.martin gmail.com> 17 16 """ 18 17 … … 27 26 def CheckForWx(): 28 27 """Try to import wx module and check its version""" 29 30 majorVersion = 2.8 31 minorVersion = 1.1 32 28 minVersion = [2, 8, 1, 1] 33 29 try: 34 #import wxversion35 #wxversion.select(str(majorVersion))30 import wxversion 31 wxversion.select(str(minVersion[0]) + '.' + str(minVersion[1])) 36 32 import wx 37 33 version = wx.version().split(' ')[0] 38 if float(version[:3]) < majorVersion: 39 raise ValueError('You are using wxPython version %s' % str(version)) 40 if float(version[:3]) == 2.8 and \ 41 float(version[4:]) < minorVersion: 42 raise ValueError('You are using wxPython version %s' % str(version)) 34 if map(int, version.split('.')) < minVersion: 35 raise ValueError('Your wxPython version is %s.%s.%s.%s' % tuple(version.split('.'))) 43 36 44 37 except (ImportError, ValueError, wxversion.VersionError), e: 45 print >> sys.stderr, 'ERROR: ' + str(e) + \ 46 '. wxPython >= %s.%s is required. Detailed information in README file.' % \ 47 (str(majorVersion), str(minorVersion)) 38 print >> sys.stderr, 'ERROR: wxGUI requires wxPython >= %d.%d.%d.%d. ' % tuple(minVersion) + \ 39 '%s. Detailed information in README file.' % (str(e)) 48 40 sys.exit(1) 49 41 except locale.Error, e:
Note:
See TracChangeset
for help on using the changeset viewer.
