Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes Class Reference

List of all members.

Public Member Functions

def __init__
def close
def __iter__
def next

Public Attributes


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

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

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

Definition at line 357 of file

Constructor & Destructor Documentation

def (   self,
  buffer_size = 8192 

Definition at line 372 of file

00373     def __init__(self, file, buffer_size=8192):
00374         self.file = file
00375         self.buffer_size = buffer_size

Member Function Documentation

Definition at line 380 of file

00381     def __iter__(self):
00382         return self

Definition at line 376 of file

00377     def close(self):
00378         if hasattr(self.file, 'close'):
00379             self.file.close()

Here is the caller graph for this function:

Definition at line 383 of file

00384     def next(self):
00385         data =
00386         if data:
00387             return data
00388         raise StopIteration()

Here is the caller graph for this function:

Member Data Documentation

Definition at line 374 of file

Definition at line 373 of file

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