1
2
3
4
5
6
7
8
9 import sys
10
11 required_ver_maj = str(2)
12 required_ver_min = str(7)
13 required_ver_sub = str(1)
14
15 python_version = str(sys.version[0:5])
16 python_ver_maj = str(sys.version[0:1])
17 python_ver_min = str(sys.version[2:3])
18 python_ver_sub = str(sys.version[4:5])
19
20 if (python_ver_maj != required_ver_maj or
21 python_ver_min != required_ver_min or
22 python_ver_sub != required_ver_sub):
23 sys.stderr.write("ERROR: The SAGA Python modules were compiled for "
24 "Python "+required_ver_maj+"."+required_ver_min+"."+required_ver_sub+
25 " but you are using them with Python "+python_version+".\n")
26 exit(1)
27
28 from _engine import *
29
30
31
32 import os
33 SAGA_LOG = 0
34 try:
35 SAGA_LOG = long(os.getenv("SAGA_VERBOSE", "0"))
36 except:
37 pass
38
39
40 try:
41 import saga.name_space
42 if (SAGA_LOG != 0):
43 print "Successfully loaded Python namespace package bindings"
44 except:
45 if (SAGA_LOG != 0):
46 print "Failed loading Python namespace package bindings"
47
48
49 try:
50 import saga.filesystem
51 if (SAGA_LOG != 0):
52 print "Successfully loaded Python filesystem package bindings"
53 except:
54 if (SAGA_LOG != 0):
55 print "Failed loading Python filesystem package bindings"
56
57
58 try:
59 import saga.advert
60 if (SAGA_LOG != 0):
61 print "Successfully loaded Python advert package bindings"
62 except:
63 if (SAGA_LOG != 0):
64 print "Failed loading Python advert package bindings"
65
66
67 try:
68 import saga.job
69 if (SAGA_LOG != 0):
70 print "Successfully loaded Python job package bindings"
71 except:
72 if (SAGA_LOG != 0):
73 print "Failed loading Python job package bindings"
74
75
76 try:
77 import saga.replica
78 if (SAGA_LOG != 0):
79 print "Successfully loaded Python replica package bindings"
80 except:
81 if (SAGA_LOG != 0):
82 print "Failed loading Python replica package bindings"
83
84
85 try:
86 import saga.cpr
87 if (SAGA_LOG != 0):
88 print "Successfully loaded Python cpr package bindings"
89 except:
90 if (SAGA_LOG != 0):
91 print "Failed loading Python cpr package bindings"
92
93
94 try:
95 import saga.sd
96 if (SAGA_LOG != 0):
97 print "Successfully loaded Python sd package bindings"
98 except:
99 if (SAGA_LOG != 0):
100 print "Failed loading Python sd package bindings"
101
102
103 try:
104 import saga.stream
105 if (SAGA_LOG != 0):
106 print "Successfully loaded Python stream package bindings"
107 except:
108 if (SAGA_LOG != 0):
109 print "Failed loading Python stream package bindings"
110
111
112
113
118
121
124
127
130
133
136
139
146
147 _engine.exception = exception
148 _engine._exception.py_err_class = exception
149
150
152
153 _engine.not_implemented = not_implemented
154 _engine._not_implemented.py_err_class = not_implemented
155
156
158
159 _engine.parameter_exception = parameter_exception
160 _engine._parameter_exception.py_err_class = parameter_exception
161
162
164
165 _engine.incorrect_url = incorrect_url
166 _engine._incorrect_url.py_err_class = incorrect_url
167
168
170
171 _engine.bad_parameter = bad_parameter
172 _engine._bad_parameter.py_err_class = bad_parameter
173
174
176
177 _engine.state_exception = state_exception
178 _engine._state_exception.py_err_class = state_exception
179
180
182
183 _engine.already_exists = already_exists
184 _engine._already_exists.py_err_class = already_exists
185
186
188
189 _engine.does_not_exist = does_not_exist
190 _engine._does_not_exist.py_err_class = does_not_exist
191
192
194
195 _engine.incorrect_state = incorrect_state
196 _engine._incorrect_state.py_err_class = incorrect_state
197
198
199 -class timeout(state_exception): pass
200
201 _engine.timeout = timeout
202 _engine._timeout.py_err_class = timeout
203
204
206
207 _engine.security_exception = security_exception
208 _engine._security_exception.py_err_class = security_exception
209
210
212
213 _engine.permission_denied = permission_denied
214 _engine._permission_denied.py_err_class = permission_denied
215
216
218
219 _engine.authorization_failed = authorization_failed
220 _engine._authorization_failed.py_err_class = authorization_failed
221
222
224
225 _engine.authentication_failed = authentication_failed
226 _engine._authentication_failed.py_err_class = authentication_failed
227
228
230
231 _engine.no_success = no_success
232 _engine._no_success.py_err_class = no_success
233