Changeset 2033
- Timestamp:
- 08/18/08 12:57:05
- Files:
-
- trunk/cherrypy/_cprequest.py (modified) (2 diffs)
- trunk/cherrypy/lib/__init__.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/_cprequest.py
r1994 r2033 9 9 from cherrypy import _cpcgifs, _cpconfig 10 10 from cherrypy._cperror import format_exc, bare_error 11 from cherrypy.lib import http 11 from cherrypy.lib import http, file_generator 12 12 13 13 … … 748 748 749 749 750 def file_generator(input, chunkSize=65536):751 """Yield the given input (a file object) in chunks (default 64k). (Core)"""752 chunk = input.read(chunkSize)753 while chunk:754 yield chunk755 chunk = input.read(chunkSize)756 input.close()757 758 759 750 class Body(object): 760 751 """The body of the HTTP response (the response entity).""" trunk/cherrypy/lib/__init__.py
r1794 r2033 134 134 return _Builder().build(obj) 135 135 136 137 def file_generator(input, chunkSize=65536): 138 """Yield the given input (a file object) in chunks (default 64k). (Core)""" 139 chunk = input.read(chunkSize) 140 while chunk: 141 yield chunk 142 chunk = input.read(chunkSize) 143 input.close() 144 145 146

