/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/UI/main.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/UI/main.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1232 by jonathan, Wed Jun 18 14:47:06 2003 UTC revision 1392 by jonathan, Thu Jul 10 14:54:16 2003 UTC
# Line 16  __version__ = "$Revision$" Line 16  __version__ = "$Revision$"
16  import sys  import sys
17    
18  from application import ThubanApplication  from application import ThubanApplication
19    import Thuban.version
 from wxPython.wx import wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER,\  
                         wxPlatform  
 import wxproj  
   
20    
21  def main():  def main():
22      """Instantiate the application object and run the application"""      """Instantiate the application object and run the application"""
# Line 29  def main(): Line 25  def main():
25          app = ThubanApplication(0)          app = ThubanApplication(0)
26          if len(sys.argv) > 1:          if len(sys.argv) > 1:
27              app.OpenSession(sys.argv[1])              app.OpenSession(sys.argv[1])
28            sys.excepthook = app.ShowExceptionDialog
29          app.MainLoop()          app.MainLoop()
30            sys.excepthook = sys.__excepthook__
31    
32    
 def wxCHECK_VERSION(major,minor,release): \  
     return (wxMAJOR_VERSION > (major) or \  
         (wxMAJOR_VERSION == (major) \  
             and wxMINOR_VERSION > (minor)) or \  
         (wxMAJOR_VERSION == (major) \  
             and wxMINOR_VERSION == (minor) \  
             and wxRELEASE_NUMBER >= (release)))  
   
33  def verify_versions():  def verify_versions():
34      """Check some library versions.      """Check some library versions.
35    
36      Print a message containing any libraries which are wrong.      Print a message containing any libraries which are wrong.
37      Return True if everything is OK, otherwise False.      Return True if everything is OK, otherwise False.
   
     Specifically, check the following libraries:  
   
         wxPython >= v2.4.0  
         Python >= v2.2.1  
         proj >= v4.4.5  
         gtk > v1.2.0  
38      """      """
39            
40      errors = []      errors = Thuban.version.verify_versions()
   
     if not wxCHECK_VERSION(2, 4, 0):  
         errors.append("wxPython < 2.4.0")  
   
     if sys.hexversion < 0x0202010f:  
         errors.append("Python < 2.2.1")  
   
     #  
     # This only tells someone that they COMPILED thuban with the wrong  
     # version of proj. If they are running prebuilt binaries  
     # check_version should always return true.  
     #  
     if not wxproj.check_version(4, 4, 5):  
         errors.append("proj < 4.4.5")  
   
     if wxPlatform == "__WXGTK__":  
         if not wxproj.check_version_gtk(1, 2, 0):  
             errors.append("gtk < 1.2")  
41    
42      if len(errors) > 0:      if len(errors) > 0:
43          msg = " The following version errors were detected:"          msg = " The following version errors were detected:"

Legend:
Removed from v.1232  
changed lines
  Added in v.1392

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26