Revision 1684
Added by Aaron Marcuse-Kubitza almost 13 years ago
streams.py | ||
---|---|---|
54 | 54 |
self.trace(str_) |
55 | 55 |
return self.stream.write(str_) |
56 | 56 |
|
57 |
class LineCountOutputStream(TracedStream):
|
|
58 |
'''Wraps an output stream, making the current line number available.
|
|
57 |
class LineCountStream(TracedStream): |
|
58 |
'''Wraps a unidirectional stream, making the current line number available.
|
|
59 | 59 |
Lines start counting from 1.''' |
60 | 60 |
def __init__(self, stream): |
61 | 61 |
self.line_num = 1 |
Also available in: Unified diff
streams.py: Renamed LineCountOutputStream to LineCountStream since TracedStream now works on both input and output streams