From 3c284ad29ca741cd7eaee8ded798e47f1630fc27 Mon Sep 17 00:00:00 2001 From: enkore Date: Sat, 2 Mar 2013 17:34:53 +0100 Subject: [PATCH] Docstrings and such --- i3pystatus/core/io.py | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/i3pystatus/core/io.py b/i3pystatus/core/io.py index e5b4144..f45af2c 100644 --- a/i3pystatus/core/io.py +++ b/i3pystatus/core/io.py @@ -25,9 +25,11 @@ class IOHandler: return def read_line(self): - """Interrupted respecting reader for stdin. + """ + Interrupted respecting reader for stdin. - Raises EOFError if the end of stream has been reached""" + Raises EOFError if the end of stream has been reached + """ try: line = self.inp.readline().strip() @@ -48,12 +50,7 @@ class StandaloneIO(IOHandler): """ n = -1 - proto = ( - '{"version":1}', - "[", - "[]", - ",[]", - ) + proto = ('{"version":1}', "[", "[]", ",[]", ) def __init__(self, interval=1): super().__init__() @@ -87,14 +84,9 @@ class JSONIO: @contextmanager def parse_line(self, line): - """ - Parse a single line of JSON and write modified JSON back. - - Usage is quite simple using the usual with-Syntax. - """ + """Parse a single line of JSON and write modified JSON back.""" prefix = "" - # ignore comma at start of lines if line.startswith(","): line, prefix = line[1:], ","