×
Namespaces

Variants
Actions
Revision as of 05:38, 27 July 2012 by hamishwillee (Talk | contribs)

Archived:Exception harness for PySymbian

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: User:Kandyfloss (15 Apr 2008)
Last edited: hamishwillee (27 Jul 2012)

This method is used for debugging standalone applications in PySymbian

try:
# Actual program is here.
1 / 0
except:
import sys
import traceback
import e32
import appuifw
appuifw.app.screen="normal" # Restore screen to normal size.
appuifw.app.focus=None # Disable focus callback.
body=appuifw.Text()
appuifw.app.body=body # Create and use a text control.
applock=e32.Ao_lock()
def quit():applock.signal()
appuifw.app.exit_key_handler=quit # Override softkey handler.
appuifw.app.menu=[(u"Exit", quit)] # Override application menu.
body.set(unicode("\n".join(traceback.format_exception(*sys.exc_info()))))
applock.wait() # Wait for exit key to be pressed.
appuifw.app.set_exit()

More methods for debugging standalone applications in Python can be found in the article PySymbian debugging techniques.

41 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×