From: W. Trevor King Date: Fri, 7 Mar 2014 04:21:20 +0000 (-0800) Subject: irkerd: Use self instead of LineBufferedStream in lines() X-Git-Tag: 2.7~12 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=86cd0f2e083eef45f749f2e92f9d4643408e27d0;p=irker.git irkerd: Use self instead of LineBufferedStream in lines() That's what 'self' is for ;). Also prefix 'crlf_re' with an underscore to mark it as private data, and not part of LineBufferedStream's API. --- diff --git a/irkerd b/irkerd index fcf7fab..3b30a20 100755 --- a/irkerd +++ b/irkerd @@ -185,7 +185,7 @@ class IRCClient(): class LineBufferedStream(): "Line-buffer a read stream." - crlf_re = re.compile(b'\r?\n') + _crlf_re = re.compile(b'\r?\n') def __init__(self): self.buffer = '' @@ -195,7 +195,7 @@ class LineBufferedStream(): def lines(self): "Iterate over lines in the buffer." - lines = LineBufferedStream.crlf_re.split(self.buffer) + lines = self._crlf_re.split(self.buffer) self.buffer = lines.pop() return iter(lines)