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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1232 - (show annotations)
Wed Jun 18 14:47:06 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/UI/main.py
File MIME type: text/x-python
File size: 2429 byte(s)
(main): Remove call to ShowLegend.

1 #! /usr/bin/python
2 # Copyright (C) 2001, 2002 by Intevation GmbH
3 # Authors:
4 # Jan-Oliver Wagner <[email protected]>
5 # Bernhard Herzog <[email protected]>
6 #
7 # This program is free software under the GPL (>=v2)
8 # Read the file COPYING coming with Thuban for details.
9
10 """
11 The main entry point for the Thuban GUI.
12 """
13
14 __version__ = "$Revision$"
15
16 import sys
17
18 from application import ThubanApplication
19
20 from wxPython.wx import wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER,\
21 wxPlatform
22 import wxproj
23
24
25 def main():
26 """Instantiate the application object and run the application"""
27
28 if verify_versions():
29 app = ThubanApplication(0)
30 if len(sys.argv) > 1:
31 app.OpenSession(sys.argv[1])
32 app.MainLoop()
33
34
35 def wxCHECK_VERSION(major,minor,release): \
36 return (wxMAJOR_VERSION > (major) or \
37 (wxMAJOR_VERSION == (major) \
38 and wxMINOR_VERSION > (minor)) or \
39 (wxMAJOR_VERSION == (major) \
40 and wxMINOR_VERSION == (minor) \
41 and wxRELEASE_NUMBER >= (release)))
42
43 def verify_versions():
44 """Check some library versions.
45
46 Print a message containing any libraries which are wrong.
47 Return True if everything is OK, otherwise False.
48
49 Specifically, check the following libraries:
50
51 wxPython >= v2.4.0
52 Python >= v2.2.1
53 proj >= v4.4.5
54 gtk > v1.2.0
55 """
56
57 errors = []
58
59 if not wxCHECK_VERSION(2, 4, 0):
60 errors.append("wxPython < 2.4.0")
61
62 if sys.hexversion < 0x0202010f:
63 errors.append("Python < 2.2.1")
64
65 #
66 # This only tells someone that they COMPILED thuban with the wrong
67 # version of proj. If they are running prebuilt binaries
68 # check_version should always return true.
69 #
70 if not wxproj.check_version(4, 4, 5):
71 errors.append("proj < 4.4.5")
72
73 if wxPlatform == "__WXGTK__":
74 if not wxproj.check_version_gtk(1, 2, 0):
75 errors.append("gtk < 1.2")
76
77 if len(errors) > 0:
78 msg = " The following version errors were detected:"
79
80 for e in errors:
81 msg += "\n " + e
82
83 # if use_msg_box:
84 # # XXX: use a message box to display the errors
85 # pass
86
87 print "\n*******************************************************"
88 print msg
89 print "*******************************************************\n"
90
91 return False
92
93 return True

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26