From f3f76e9b47492b60f9fc6e7735be332d36b97eaa Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 29 Mar 2015 01:06:31 +0100 Subject: small fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- examples/plugins/ropty | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'examples/plugins/ropty') diff --git a/examples/plugins/ropty b/examples/plugins/ropty index 5e41351..8c9c845 100644 --- a/examples/plugins/ropty +++ b/examples/plugins/ropty @@ -1,6 +1,6 @@ # -*- python -*- -# A xpybar configuration example testing the features of plugins.kmsg +# A xpybar configuration example testing the features of plugins.ropty from plugins.ropty import ROPTY @@ -15,12 +15,11 @@ def start(): global pty_ start_() def refresh(): - if pty_.size() == 0: - text = '' - else: - line = pty_.next - text = '\033[37;41m%i\033[00m%s' - text %= (pty_.size(), line) + global text + line = pty_.next() + if line == '': + return + text = '\033[37;41m%i\033[00m%s' % (pty_.size(), line.replace('\x07', '')) bar.invalidate() pty_ = ROPTY(refresh) -- cgit v1.2.3-70-g09d2