Author: Hakan Ardo <[email protected]>
Branch: extradoc
Changeset: r4880:8c1a7728e420
Date: 2012-10-19 10:16 +0200
http://bitbucket.org/pypy/extradoc/changeset/8c1a7728e420/
Log: key for skipping to end of demo
diff --git a/talk/dls2012/demo/demo.py b/talk/dls2012/demo/demo.py
--- a/talk/dls2012/demo/demo.py
+++ b/talk/dls2012/demo/demo.py
@@ -38,10 +38,16 @@
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:
@@ -57,10 +63,14 @@
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()
@@ -246,7 +256,6 @@
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__':
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit