My patch cmd.py pour keyboardinterrupt

--- backuo/cmd.py       2007-10-19 13:54:25.000000000 +0200
+++ cmd.py      2007-10-19 14:19:54.000000000 +0200
@@ -130,6 +130,13 @@
                             line = raw_input(self.prompt)
                         except EOFError:
                             line = 'EOF'
+                        except KeyboardInterrupt:
+                            self.stdout.write('nare you sure you want to exit?
 y/n ')
+                            answer =''
+                            while (answer != 'y') & (answer != 'n'):
+                                answer = raw_input()
+                                if answer == 'y':
+                                    exit(0)    
                     else:
                         self.stdout.write(self.prompt)
                         self.stdout.flush()

Pas d'articles similaires.

Posted in python. Bookmark the permalink. RSS feed for this post. Leave a trackback.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Protected by WP Anti Spam

Swedish Greys - a WordPress theme from Nordic Themepark.