[pyrepl-checkins] r53453 - pyrepl/trunk/pyrepl/pyrepl

arigo at codespeak.net arigo at codespeak.net
Sun Apr 6 16:30:46 CEST 2008


Author: arigo
Date: Sun Apr  6 16:30:45 2008
New Revision: 53453

Modified:
   pyrepl/trunk/pyrepl/pyrepl/commands.py
   pyrepl/trunk/pyrepl/pyrepl/reader.py
Log:
Don't leave a previous error message on the screen when leaving with
Ctrl-D.


Modified: pyrepl/trunk/pyrepl/pyrepl/commands.py
==============================================================================
--- pyrepl/trunk/pyrepl/pyrepl/commands.py	(original)
+++ pyrepl/trunk/pyrepl/pyrepl/commands.py	Sun Apr  6 16:30:45 2008
@@ -333,6 +333,7 @@
         b = r.buffer
         if  ( r.pos == 0 and len(b) == 0 # this is something of a hack
               and self.event[-1] == "\004"):
+            r.immediately_clear_message()
             r.console.finish()
             raise EOFError
         for i in range(r.get_arg()):

Modified: pyrepl/trunk/pyrepl/pyrepl/reader.py
==============================================================================
--- pyrepl/trunk/pyrepl/pyrepl/reader.py	(original)
+++ pyrepl/trunk/pyrepl/pyrepl/reader.py	Sun Apr  6 16:30:45 2008
@@ -466,6 +466,13 @@
         self.dirty = 1
         self.console.beep()
 
+    def immediately_clear_message(self):
+        if self.msg:
+            self.msg = ''
+            self.dirty = 1
+        if self.dirty:
+            self.refresh()
+
     def refresh(self):
         """Recalculate and refresh the screen."""
         # this call sets up self.cxy, so call it first.


More information about the pyrepl-checkins mailing list