Package smisk :: Module core :: Class Stream
[frames] | no frames]

Class Stream

object --+
         |
        Stream

FastCGI input/output stream
Instance Methods
 
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
__iter__(x)
iter(x)
a new object with type S, a subtype of T
__new__(T, S, ...)
None
close(...)
Close the stream.
None
flush(...)
Flush the internal buffer.
the next value, or raise StopIteration
next(x)
string
read(...)
Read at most size bytes from the file (less if the read hits EOF before obtaining size bytes).
string
readline(...)
Read one entire line from the file.
None
write(...)
Write data to the stream.
None
write_byte(...)
Write a byte to the stream.

Inherited from object: __delattr__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties

Inherited from object: __class__

Method Details

__init__(...)
(Constructor)

 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__

__new__(T, S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

close(...)

 
Close the stream. You should never need to close a FastCGI stream, as it's safely handled by the internals of the parent request object.
Returns: None

flush(...)

 
Flush the internal buffer. This reduces performance and is only needed for "server-push" applications. The parent request object always implicitly flushes all it's streams upon finishing the request.
Returns: None

read(...)

 
Read at most size bytes from the file (less if the read hits EOF before obtaining size bytes). If the size argument is negative or omitted, read all data until EOF is reached.
Parameters:
  • length (int) - read up to length bytes. If not specified or negative, read until EOF.
Returns: string

readline(...)

 
Read one entire line from the file. A trailing newline character is kept in the string (but may be absent when a file ends with an incomplete line) If the size argument is present and non-negative, it is a maximum byte count (including the trailing newline) and an incomplete line may be returned. An empty string is returned only when EOF is encountered immediately
Parameters:
  • length (int) - read up to length bytes.
Returns: string
the line read or None if EOF

write(...)

 

Write data to the stream.

It is guaranteed to write all bytes. If any byte fails to be written, a smisk.IOError is raised.

Parameters:
  • str (string) - a string
  • length (int) - write length bytes from str (optional)
Returns: None
Raises:

write_byte(...)

 
Write a byte to the stream.
Parameters:
  • b (int) - The byte to write
Returns: None
Raises: