/usr/share/pymt-examples/framework/exceptions.py is in python-pymt 0.5.1-0ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # Simple exemple of exception handler
# Exeption will be catch, and set the return to PASS
# So, app will be not stopped by this.
from pymt import *
class E(ExceptionHandler):
def handle_exception(self, inst):
pymt_logger.exception(inst)
return ExceptionManager.PASS
pymt_exception_manager.add_handler(E())
m = MTWindow()
t = MTButton()
@t.event
def on_press(*largs):
print a
m.add_widget(t)
runTouchApp()
|