Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 2033

Show
Ignore:
Timestamp:
08/18/08 12:57:05
Author:
visteya
Message:

moved file_generator from _cprequest.py to lib/init.py

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/_cprequest.py

    r1994 r2033  
    99from cherrypy import _cpcgifs, _cpconfig 
    1010from cherrypy._cperror import format_exc, bare_error 
    11 from cherrypy.lib import http 
     11from cherrypy.lib import http, file_generator 
    1212 
    1313 
     
    748748 
    749749 
    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 chunk 
    755         chunk = input.read(chunkSize) 
    756     input.close() 
    757  
    758  
    759750class Body(object): 
    760751    """The body of the HTTP response (the response entity).""" 
  • trunk/cherrypy/lib/__init__.py

    r1794 r2033  
    134134    return _Builder().build(obj) 
    135135 
     136 
     137def 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 

Hosted by WebFaction

Log in as guest/cpguest to create tickets