Project

General

Profile

« Previous | Next » 

Revision 4917

streams.py: Line iteration: Added read_all()

View differences:

lib/streams.py
1 1
# I/O
2 2

  
3
import operator
3 4
import timeouts
4 5

  
5 6
##### Exceptions
......
47 48
def consume(in_):
48 49
    for line in StreamIter(in_): pass
49 50

  
51
def read_all(stream): return reduce(operator.add, StreamIter(stream), '')
52

  
50 53
##### Timeouts
51 54

  
52 55
class TimeoutInputStream(WrapStream):

Also available in: Unified diff