OpenQuizz
Une application de gestion des contenus pédagogiques
FileWrapper Class Reference
Inheritance diagram for FileWrapper:
Collaboration diagram for FileWrapper:

Public Member Functions

def __init__ (self, file, buffer_size=8192)
 
def close (self)
 
def seekable (self)
 
def seek (self, *args)
 
def tell (self)
 
def __iter__ (self)
 
def __next__ (self)
 

Data Fields

 file
 
 buffer_size
 

Detailed Description

This class can be used to convert a :class:`file`-like object into
an iterable.  It yields `buffer_size` blocks until the file is fully
read.

You should not use this class directly but rather use the
:func:`wrap_file` function that uses the WSGI server's file wrapper
support if it's available.

.. versionadded:: 0.5

If you're using this object together with a :class:`BaseResponse` you have
to use the `direct_passthrough` mode.

:param file: a :class:`file`-like object with a :meth:`~file.read` method.
:param buffer_size: number of bytes for one iteration.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  file,
  buffer_size = 8192 
)

Member Function Documentation

◆ __iter__()

def __iter__ (   self)

◆ __next__()

def __next__ (   self)

◆ close()

def close (   self)

◆ seek()

def seek (   self,
args 
)

◆ seekable()

def seekable (   self)

◆ tell()

def tell (   self)

Field Documentation

◆ buffer_size

buffer_size

◆ file

file

The documentation for this class was generated from the following file: