Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
wsgiref.validate.IteratorWrapper Class Reference

List of all members.

Public Member Functions

def __init__
def __iter__
def __next__
def close
def __del__

Public Attributes

 original_iterator
 iterator
 closed
 check_start_response

Detailed Description

Definition at line 263 of file validate.py.


Constructor & Destructor Documentation

def wsgiref.validate.IteratorWrapper.__init__ (   self,
  wsgi_iterator,
  check_start_response 
)

Definition at line 265 of file validate.py.

00265 
00266     def __init__(self, wsgi_iterator, check_start_response):
00267         self.original_iterator = wsgi_iterator
00268         self.iterator = iter(wsgi_iterator)
00269         self.closed = False
00270         self.check_start_response = check_start_response

Here is the caller graph for this function:

Definition at line 291 of file validate.py.

00291 
00292     def __del__(self):
00293         if not self.closed:
00294             sys.stderr.write(
00295                 "Iterator garbage collected without being closed")
00296         assert_(self.closed,
00297             "Iterator garbage collected without being closed")

Here is the call graph for this function:


Member Function Documentation

Definition at line 271 of file validate.py.

00271 
00272     def __iter__(self):
00273         return self

Definition at line 274 of file validate.py.

00274 
00275     def __next__(self):
00276         assert_(not self.closed,
00277             "Iterator read after closed")
00278         v = next(self.iterator)
00279         if type(v) is not bytes:
00280             assert_(False, "Iterator yielded non-bytestring (%r)" % (v,))
00281         if self.check_start_response is not None:
00282             assert_(self.check_start_response,
00283                 "The application returns and we started iterating over its body, but start_response has not yet been called")
00284             self.check_start_response = None
00285         return v

Here is the call graph for this function:

Definition at line 286 of file validate.py.

00286 
00287     def close(self):
00288         self.closed = True
00289         if hasattr(self.original_iterator, 'close'):
00290             self.original_iterator.close()

Here is the caller graph for this function:


Member Data Documentation

Definition at line 269 of file validate.py.

Definition at line 268 of file validate.py.

Definition at line 267 of file validate.py.

Definition at line 266 of file validate.py.


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