

def app_iter_range(self, seek=None, limit=None, block_size=None):
    'Iter over the content of the file.\n\n        You can set the `seek` parameter to read the file starting from a\n        specific position.\n\n        You can set the `limit` parameter to read the file up to specific\n        position.\n\n        Finally, you can change the number of bytes read at once by setting the\n        `block_size` parameter.\n        '
    if (block_size is None):
        block_size = BLOCK_SIZE
    if seek:
        self.file.seek(seek)
        if (limit is not None):
            limit -= seek
    try:
        while True:
            data = self.file.read((min(block_size, limit) if (limit is not None) else block_size))
            if (not data):
                return
            (yield data)
            if (limit is not None):
                limit -= len(data)
                if (limit <= 0):
                    return
    finally:
        self.file.close()

dataset/ETHPy150Open AppScale/appscale/AppServer/lib/webob-1.2.3/webob/static.py FileIter.app_iter_range/original