Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
wsgiref.util.FileWrapper Class Reference

List of all members.

Public Member Functions

def __init__
def __getitem__
def __iter__
def __next__

Public Attributes

 filelike
 blksize
 close

Detailed Description

Wrapper to convert file-like objects to iterables

Definition at line 11 of file util.py.


Constructor & Destructor Documentation

def wsgiref.util.FileWrapper.__init__ (   self,
  filelike,
  blksize = 8192 
)

Definition at line 14 of file util.py.

00014 
00015     def __init__(self, filelike, blksize=8192):
00016         self.filelike = filelike
00017         self.blksize = blksize
00018         if hasattr(filelike,'close'):
00019             self.close = filelike.close

Here is the caller graph for this function:


Member Function Documentation

def wsgiref.util.FileWrapper.__getitem__ (   self,
  key 
)

Definition at line 20 of file util.py.

00020 
00021     def __getitem__(self,key):
00022         data = self.filelike.read(self.blksize)
00023         if data:
00024             return data
00025         raise IndexError

Definition at line 26 of file util.py.

00026 
00027     def __iter__(self):
00028         return self

Definition at line 29 of file util.py.

00029 
00030     def __next__(self):
00031         data = self.filelike.read(self.blksize)
00032         if data:
00033             return data
00034         raise StopIteration


Member Data Documentation

Definition at line 16 of file util.py.

Definition at line 18 of file util.py.

Definition at line 15 of file util.py.


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