From 26cc3ff27a3ae202cb3231dd8c5b3dfe820b421d Mon Sep 17 00:00:00 2001 From: enkore Date: Sat, 23 Feb 2013 14:06:55 +0100 Subject: [PATCH] . --- i3pystatus/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/i3pystatus/__init__.py b/i3pystatus/__init__.py index 34cfa82..c7d57ee 100644 --- a/i3pystatus/__init__.py +++ b/i3pystatus/__init__.py @@ -130,7 +130,10 @@ class StandaloneIO(IOHandler): def read(self): while True: yield self.read_line() - time.sleep(self.interval) + try: + time.sleep(self.interval) + except KeyboardInterrupt: + return def read_line(self): self.n += 1 @@ -208,7 +211,7 @@ class i3pystatus: # If the user does this: register(modsde, mdesettings) with mdesettings # being a dict Python will put mdesettings into the position argument # , and not into *args. Let's fix that. - # If she uses keyword arguments, everything is fine right from the beginning :-) + # If she uses keyword arguments, everything is fine :-) args = (position,) position = 0