From af1aac95578d9d52ec9be031f83a10faaf83106f Mon Sep 17 00:00:00 2001 From: Bob Farrell Date: Mon, 15 Dec 2008 19:16:08 +0000 Subject: [PATCH] "flush_output" option added to config controls whether output will be flushed to stdout or not. --- CHANGELOG | 3 +++ bpython/cli.py | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 07349e8..042f406 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,6 +6,9 @@ Menno sent me some patches to fix some stuff: 'self' in arg list is now highlighted a different colour. +flush_output option added to config to control whether output is flushed to +stdout or not on exit. + v0.7.1 ====== Added support for a history file, defaults to ~/.pythonhist and 100 lines but diff --git a/bpython/cli.py b/bpython/cli.py index d55295f..5ef803b 100644 --- a/bpython/cli.py +++ b/bpython/cli.py @@ -110,6 +110,7 @@ OPTS.syntax = True OPTS.arg_spec = True OPTS.hist_file = '~/.pythonhist' OPTS.hist_length = 100 +OPTS.flush_output = True # TODO: # @@ -1733,7 +1734,8 @@ def main(): sys.exit(1) # Fake stdout data so everything's still visible after exiting - sys.stdout.write(o) + if OPTS.flush_output: + sys.stdout.write(o) sys.stdout.flush() if __name__ == '__main__':