t.w.w.InputStream(object) : class documentation

Part of twisted.web2.wsgi View Source View In Hierarchy

This class implements the 'wsgi.input' object. The methods are expected to have the same behavior as the same-named methods for python's builtin file object.
Method __init__ Undocumented
Method read Read at most size bytes from the input, or less if EOF is encountered. If size is ommitted or negative, read until EOF.
Method readline Read a line, delimited by a newline. If the stream reaches EOF or size bytes have been read before reaching a newline (if size is given), the partial line is returned.
Method readlines Read until EOF, collecting all lines in a list, and returns that list. The hint argument is ignored (as is allowed in the API specification)
Method __iter__ Returns an iterator, each iteration of which returns the result of readline(), and stops when readline() returns an empty string.
def __init__(self, newstream): (source)
Undocumented
def read(self, size=None): (source)
Read at most size bytes from the input, or less if EOF is encountered. If size is ommitted or negative, read until EOF.
def readline(self, size=None): (source)

Read a line, delimited by a newline. If the stream reaches EOF or size bytes have been read before reaching a newline (if size is given), the partial line is returned.

COMPATIBILITY NOTE: the size argument is excluded from the WSGI specification, but is provided here anyhow, because useful libraries such as python stdlib's cgi.py assume their input file-like-object supports readline with a size argument. If you use it, be aware your application may not be portable to other conformant WSGI servers.
def readlines(self, hint=None): (source)
Read until EOF, collecting all lines in a list, and returns that list. The hint argument is ignored (as is allowed in the API specification)
def __iter__(self): (source)
Returns an iterator, each iteration of which returns the result of readline(), and stops when readline() returns an empty string.
API Documentation for Twisted, generated by pydoctor at 2011-10-27 16:17:34.