From d9a6fee7c0a320e1ce1340042828de96b9fffab1 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 26 Jul 2013 11:53:23 +0200 Subject: m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/featherweight.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/featherweight.py') diff --git a/src/featherweight.py b/src/featherweight.py index ebab4e6..e32a66d 100755 --- a/src/featherweight.py +++ b/src/featherweight.py @@ -25,9 +25,6 @@ from subprocess import Popen, PIPE from flocker import * -height_width = Popen('stty size'.split(' '), stdout = PIPE, stderr = PIPE).communicate()[0] -(height, width) = height_width.decode('utf-8', 'error')[:-1].split(' ') - old_stty = Popen('stty --save'.split(' '), stdout = PIPE, stderr = PIPE).communicate()[0] old_stty = old_stty.decode('utf-8', 'error')[:-1] @@ -92,6 +89,9 @@ def print_node(feed, last, indent): count = count_new(feeds) def print_tree(): + height_width = Popen('stty size'.split(' '), stdout = PIPE, stderr = PIPE).communicate()[0] + (height, width) = height_width.decode('utf-8', 'error')[:-1].split(' ') + print('\033[H\033[2J', end = '') if count > 0: print('\033[01;31m(%i)\033[00m' % count, end = ' ') @@ -223,7 +223,9 @@ try: collapsed_count += -1 if value else 1 cur['expanded'] = value print_tree() - elif buf == 'q': + elif buf.endswith(chr(ord('L') - ord('@')): + print_tree() + elif buf.endswith('q'): break elif buf.endswith('\t'): print('Tab') -- cgit v1.2.3-70-g09d2