irkerd: Use self instead of LineBufferedStream in lines()
authorW. Trevor King <wking@tremily.us>
Fri, 7 Mar 2014 04:21:20 +0000 (20:21 -0800)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 11 Mar 2014 04:50:02 +0000 (00:50 -0400)
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.

irkerd

diff --git a/irkerd b/irkerd
index fcf7fabbb0265fded54295afe610a7a6be29acf4..3b30a20b0d62c3a0ffa23e3c4962be239e07b216 100755 (executable)
--- 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)