/[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 230 by bh, Fri Jul 19 13:21:14 2002 UTC revision 1766 by jan, Wed Oct 1 09:52:28 2003 UTC
# Line 1  Line 1 
1  #! /usr/bin/python  # Copyright (C) 2001, 2002, 2003 by Intevation GmbH
 # Copyright (C) 2001, 2002 by Intevation GmbH  
2  # Authors:  # Authors:
3  # Jan-Oliver Wagner <[email protected]>  # Jan-Oliver Wagner <[email protected]>
4  # Bernhard Herzog <[email protected]>  # Bernhard Herzog <[email protected]>
# Line 16  __version__ = "$Revision$" Line 15  __version__ = "$Revision$"
15  import sys  import sys
16    
17  from application import ThubanApplication  from application import ThubanApplication
18    import Thuban.version
19    
20  def main():  def main():
21      """Instantiate the application object and run the application"""      """Instantiate the application object and run the application"""
22      app = ThubanApplication(0)  
23      if len(sys.argv) > 1:      if verify_versions():
24          app.OpenSession(sys.argv[1])          app = ThubanApplication(0)
25      app.top.ShowSessionTree()          if len(sys.argv) > 1:
26      app.MainLoop()              app.OpenSession(sys.argv[1])
27            app.MainLoop()
28            # sys.excepthook is set in ThubanApplication.OnInit()
29            sys.excepthook = sys.__excepthook__
30    
31    def verify_versions():
32        """Check some library versions.
33    
34        Print a message containing any libraries which are wrong.
35        Return True if everything is OK, otherwise False.
36        """
37        
38        errors = Thuban.version.verify_versions()
39    
40        if len(errors) > 0:
41            msg = " The following version errors were detected:"
42    
43            for e in errors:
44                msg += "\n     " + e
45    
46    #       if use_msg_box:
47    #           # XXX: use a message box to display the errors
48    #           pass
49    
50            print "\n*******************************************************"
51            print msg
52            print "*******************************************************\n"
53    
54            return False
55    
56        return True

Legend:
Removed from v.230  
changed lines
  Added in v.1766

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26