aboutsummaryrefslogtreecommitdiffstats
path: root/src/featherweight.py
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-07-26 11:53:23 +0200
committerMattias Andrée <maandree@operamail.com>2013-07-26 11:53:23 +0200
commitd9a6fee7c0a320e1ce1340042828de96b9fffab1 (patch)
tree51c575d06cf5ffdae53a71a0a967ed0f180aeef3 /src/featherweight.py
parentautoexpand (diff)
downloadpytagomacs-d9a6fee7c0a320e1ce1340042828de96b9fffab1.tar.gz
pytagomacs-d9a6fee7c0a320e1ce1340042828de96b9fffab1.tar.bz2
pytagomacs-d9a6fee7c0a320e1ce1340042828de96b9fffab1.tar.xz
m
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/featherweight.py')
-rwxr-xr-xsrc/featherweight.py10
1 files changed, 6 insertions, 4 deletions
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')