Commits

Hakan Ardo  committed 8c1a772

key for skipping to end of demo

  • Participants
  • Parent commits a0f3333

Comments (0)

Files changed (1)

File talk/dls2012/demo/demo.py

     def __del__(self):
         self.close()
 
+
+class SkipToEnd(Exception):
+    pass
+
 def pause(msg=''):
     print "\n"
     print msg
-    raw_input('Press ENTER\n')
+    res = raw_input('Press ENTER (s)\n')
+    if res == 's':
+        raise SkipToEnd
 
 def demo(skip1=False):
     if not skip1:
     runner = Popen([sys.executable, 'run.py', 'demo.avi'])
     vim = Vim('analytics.py')
 
-    if not skip1:
-        part1(vim)
-    part2(vim, skip1)
+    try:
+        if not skip1:
+            part1(vim)
+        part2(vim, skip1)
+    except SkipToEnd:
+        os.system('hg revert analytics.py background.py detect.py foreground.py')
 
+    pause("That's all! Feel free to make your own adjustments or (to quit),")
     runner.kill()
     vim.close()
 
     vim.send('>=')
     vim.type(' minarea]<ESC>:w<CR>', 0.01)
 
-    pause("That's all! Feel free to make your own adjustments or (to quit),")
 
 
 if __name__ == '__main__':