diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-10-01 03:13:59 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-10-01 03:13:59 +0000 |
commit | cecf7ccc10fbbeeaa8c9f72b359fd0a561d3bbbd (patch) | |
tree | 98d08e1e992e7d4614730837eef8b91ea2149b0f | |
parent | ef019ad47d51df02deccb780f135d01e3314eab9 (diff) | |
download | portage-cecf7ccc10fbbeeaa8c9f72b359fd0a561d3bbbd.tar.gz portage-cecf7ccc10fbbeeaa8c9f72b359fd0a561d3bbbd.tar.bz2 portage-cecf7ccc10fbbeeaa8c9f72b359fd0a561d3bbbd.zip |
Bug #142508 - Clear the screen each time before calling
the "diff" command so that any remnants of the previous
config are now shown with the current one.
command so that
svn path=/main/trunk/; revision=7893
-rwxr-xr-x | bin/dispatch-conf | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/bin/dispatch-conf b/bin/dispatch-conf index e000880f0..ec19e1e4d 100755 --- a/bin/dispatch-conf +++ b/bin/dispatch-conf @@ -215,6 +215,7 @@ class dispatch: show_new_diff = 0 while 1: + clear_screen() if show_new_diff: os.system((self.options['diff']) % (conf['new'], mrgconf)) show_new_diff = 0 @@ -377,6 +378,19 @@ def getch (): termios.tcsetattr(fd, termios.TCSADRAIN, old_settings) return ch +def clear_screen(): + try: + import curses + try: + curses.setupterm() + sys.stdout.write(curses.tigetstr("clear")) + sys.stdout.flush() + return + except curses.error: + pass + except ImportError: + pass + os.system("clear 2>/dev/null") # run d = dispatch () |