From 4966f907754a30c3598fdef7daf64d78c6a73454 Mon Sep 17 00:00:00 2001 From: enkore Date: Thu, 21 Feb 2013 16:08:52 +0100 Subject: [PATCH] .dist --- i3pystatus/__init__.py | 9 ++------- i3pystatus/__main__.py.dist | 6 ++++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/i3pystatus/__init__.py b/i3pystatus/__init__.py index effd7a3..239f45b 100644 --- a/i3pystatus/__init__.py +++ b/i3pystatus/__init__.py @@ -100,12 +100,7 @@ class JSONIO: class I3statusHandler: modules = [] - - def __init__(self, fd=None): - if fd is None: - fd = sys.stdin - - self.io = JSONIO(IOHandler(fd)) + file = sys.stdin def register(self, module, position=0): """Register a new module.""" @@ -115,6 +110,6 @@ class I3statusHandler: module.registered(self) def run(self): - for j in self.io.read(): + for j in JSONIO(IOHandler(self.file)).read(): for module in self.modules: j.insert(module.position, module.output) diff --git a/i3pystatus/__main__.py.dist b/i3pystatus/__main__.py.dist index 8561d0f..04409b5 100755 --- a/i3pystatus/__main__.py.dist +++ b/i3pystatus/__main__.py.dist @@ -12,6 +12,12 @@ from i3pystatus import ( status = I3statusHandler() +# If you want to start i3status automatically with i3pystatus, +# uncomment the following lines +#import subprocess +#process = subprocess.Popen(["i3status", "-c", "~/.i3/status"], stdout=subprocess.PIPE, universal_newlines=True) +#status.file = process.stdout + # Regular expression file watcher # If you're using a thinkpad, chances are that this displays your fan speed and level regexsettings = {