SHARE
TWEET

Untitled

a guest Jan 10th, 2011 22 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ###... The rest of boot.py here
  2. ###
  3.     try:
  4.         from robot import run
  5.         print("Running user code.")
  6.         run()
  7.     except: #Would need to do some fancy stuff here to not catch RuntimeError with "Restart", or a custom exception class for restarts?
  8.         print("Unhandled exception caught.")
  9.         #Some sort of info from traceback to print the exception information?
  10.         print("Press your restart button to continue.")
  11.  
  12.         from robot import CheckRestart
  13.         while True:
  14.         #This is a bit odd because we have to do something when CheckRestart throws an exception...
  15.         try:
  16.             CheckRestart()
  17.         except RuntimeError: #Make sure that it's "Restart"
  18.             break
  19.     finally:
  20.         rollback.uninstall()
RAW Paste Data
Top