From 6eccd04fbb8f60fae8c6137dfc51ddfdec4a029c Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 13 May 2013 05:22:44 +0200 Subject: more trimming MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/trim.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/trim.py b/src/trim.py index c0824da..47578d9 100755 --- a/src/trim.py +++ b/src/trim.py @@ -20,6 +20,7 @@ text = False +firsttext = True while True: try: @@ -40,11 +41,14 @@ while True: if lower.startswith('text '): text = True - print(line) + if firsttext: + print(line) elif lower == 'endtext': text = False - print(line) - elif text or (lower.split(' ')[0] in ('timeout', 'menu', 'label', 'font')): + if firsttext: + print(line) + firsttext = False + elif (text and firsttext) or (lower.split(' ')[0] in ('timeout', 'menu', 'font')): print(line) except: break -- cgit v1.2.3-70-g09d2