MCPcopy Index your code
hub / github.com/fluentpython/example-code-2e / WSGIFileWrapper

Class WSGIFileWrapper

21-async/mojifinder/bottle.py:2233–2245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2231
2232
2233class WSGIFileWrapper(object):
2234
2235 def __init__(self, fp, buffer_size=1024*64):
2236 self.fp, self.buffer_size = fp, buffer_size
2237 for attr in ('fileno', 'close', 'read', 'readlines', 'tell', 'seek'):
2238 if hasattr(fp, attr): setattr(self, attr, getattr(fp, attr))
2239
2240 def __iter__(self):
2241 buff, read = self.buffer_size, self.read
2242 while True:
2243 part = read(buff)
2244 if not part: return
2245 yield part
2246
2247
2248class _closeiter(object):

Callers 1

_castMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected