234 |
save_session(self.session, self.session.filename) |
save_session(self.session, self.session.filename) |
235 |
|
|
236 |
def maps_changed(self, *args): |
def maps_changed(self, *args): |
237 |
|
"""Subscribed to the session's MAPS_CHANGED messages. |
238 |
|
|
239 |
|
Set the toplevel window's map to the map in the session. This is |
240 |
|
done by calling the window's SetMap method with the map as |
241 |
|
argument. If the session doesn't have any maps None is used |
242 |
|
instead. |
243 |
|
|
244 |
|
Currently Thuban can only really handle at most one map in a |
245 |
|
sessions so the first map in the session's list of maps as |
246 |
|
returned by the Maps method is used. |
247 |
|
""" |
248 |
if self.session.HasMaps(): |
if self.session.HasMaps(): |
249 |
self.top.SetMap(self.session.Maps()[0]) |
self.top.SetMap(self.session.Maps()[0]) |
250 |
else: |
else: |
270 |
try: |
try: |
271 |
lines = traceback.format_exception(exc_type, exc_value, |
lines = traceback.format_exception(exc_type, exc_value, |
272 |
exc_traceback) |
exc_traceback) |
273 |
message = _("An unhandled exception occurred:\n%s\n") % exc_value+\ |
message = _("An unhandled exception occurred:\n%s\n" |
274 |
_("(please report to") +\ |
"(please report to" |
275 |
" http://thuban.intevation.org/bugtracker.html)"\ |
" http://thuban.intevation.org/bugtracker.html)" |
276 |
"\n\n\n"+\ |
"\n\n%s") % (exc_value, "".join(lines)) |
|
"".join(lines) |
|
277 |
print message |
print message |
278 |
|
|
279 |
# We don't use an explicit parent here because this method might |
# We don't use an explicit parent here because this method might |