/[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 6 by bh, Tue Aug 28 15:41:52 2001 UTC revision 1502 by jonathan, Tue Jul 29 13:50:47 2003 UTC
# Line 1  Line 1 
1  #! /usr/bin/python  #! /usr/bin/python
2  # Copyright (C) 2001 by Intevation GmbH  # Copyright (C) 2001, 2002 by Intevation GmbH
3  # Authors:  # Authors:
4  # Jan-Oliver Wagner <[email protected]>  # Jan-Oliver Wagner <[email protected]>
5  # Bernhard Herzog <[email protected]>  # Bernhard Herzog <[email protected]>
# Line 15  __version__ = "$Revision$" Line 15  __version__ = "$Revision$"
15    
16  import sys  import sys
17    
18  # import wxPython.wx here to get the side effects of the wxPython  from application import ThubanApplication, show_exception_dialog
19  # import, especially setting the locale to the user's defaults throught  import Thuban.version
 # GTK. We then set the locale again to the user's defaults, but this  
 # time we're going through the standard python locale module, so all the  
 # magic necessary to make python work properly is done. Without this,  
 # something harmless like float("1.2") may fail when run under a non-C  
 # locale like de_DE  
 import wxPython.wx  
 import locale  
 locale.setlocale(locale.LC_ALL, "")  
   
 from application import ThubanApplication  
20    
21  def main():  def main():
22      """Instantiate the application object and run the application"""      """Instantiate the application object and run the application"""
23      global app  
24      app = ThubanApplication(0)      if verify_versions():
25      if len(sys.argv) > 1:          sys.excepthook = show_exception_dialog
26          app.OpenSession(sys.argv[1])          app = ThubanApplication(0)
27      app.MainLoop()          if len(sys.argv) > 1:
28                app.OpenSession(sys.argv[1])
29            app.MainLoop()
30            sys.excepthook = sys.__excepthook__
31    
32    
33    def verify_versions():
34        """Check some library versions.
35    
36        Print a message containing any libraries which are wrong.
37        Return True if everything is OK, otherwise False.
38        """
39        
40        errors = Thuban.version.verify_versions()
41    
42        if len(errors) > 0:
43            msg = " The following version errors were detected:"
44    
45            for e in errors:
46                msg += "\n     " + e
47    
48    #       if use_msg_box:
49    #           # XXX: use a message box to display the errors
50    #           pass
51    
52            print "\n*******************************************************"
53            print msg
54            print "*******************************************************\n"
55    
56            return False
57    
58        return True

Legend:
Removed from v.6  
changed lines
  Added in v.1502

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26