Extra linebreak added to stdout output and C-d behaviour changed.

The extra linebreak was irritating but I didn't notice it on my setup because I
already have a linebreak on exit, or something. Also C-d now only exits if
there's a blank line, as per the vanilla interpreter.
This commit is contained in:
Bob Farrell
2008-08-16 10:39:42 +01:00
parent 89edc92506
commit 29e2acbf96
+6 -3
View File
@@ -578,7 +578,7 @@ class Repl( object ):
"""This method returns the 'spoofed' stdout buffer, for writing to a file
or sending to a pastebin or whatever."""
return self.stdout_hist#"\n".join( self.stdout_hist )
return self.stdout_hist + '\n'
def write2file( self ):
"""Prompt for a filename and write the current contents of the stdout buffer
@@ -1006,8 +1006,11 @@ class Repl( object ):
return ''
elif self.c in ( chr(4), '^D' ): # C-d
self.do_exit = True
return None
if not self.s:
self.do_exit = True
return None
else:
return ''
elif self.c == 'KEY_F(2)':
self.write2file()