Package cssutils :: Module codec :: Class StreamReader |
[hide private]
[frames] | no frames]

# Class StreamReader

source code

       codecs.Codec --+
                      |
    codecs.StreamReader --+
                          |
                         StreamReader

Instance Methods | [hide private]
__init__(self, stream, errors=`'``strict``'`, encoding=None, force=True) Creates a StreamReader instance. | source code
decode(self, input, errors=`'``strict``'`) Decodes the object input and returns a tuple (output object, length consumed). | source code
_geterrors(self) | source code
_seterrors(self, errors) | source code
Inherited from `codecs.StreamReader`: `__enter__`, `__exit__`, `__getattr__`, `__iter__`, `next`, `read`, `readline`, `readlines`, `reset`, `seek` Inherited from `codecs.Codec`: `encode`

Properties | [hide private]
| errors

Method Details | [hide private]

### __init__(self, stream, errors=`'``strict``'`, encoding=None, force=True) (Constructor) | source code
    Creates a StreamReader instance.

    stream must be a file-like object open for reading
    (binary) data.

    The StreamReader may use different error handling
    schemes by providing the errors keyword argument. These
    parameters are predefined:

     'strict' - raise a ValueError (or a subclass)
     'ignore' - ignore the character and continue with the next
     'replace'- replace with a suitable replacement character;

    The set of allowed parameter values can be extended via
    register_error.
Overrides: codecs.StreamReader.__init__ (inherited documentation)

### decode(self, input, errors=`'``strict``'`) | source code
Decodes the object input and returns a tuple (output object, length consumed). input must be an object which provides the bf_getreadbuf buffer slot. Python strings, buffer objects and memory mapped files are examples of objects providing this slot. errors defines the error handling to apply. It defaults to 'strict' handling. The method may not store state in the Codec instance. Use StreamCodec for codecs which have to keep state in order to make encoding/decoding efficient. The decoder must be able to handle zero length input and return an empty object of the output object type in this situation. Overrides: codecs.Codec.decode (inherited documentation)

Property Details | [hide private]

### errors Get Method: _geterrors(self) Set Method: _seterrors(self, errors)