def codecs.StreamWriter.__init__ |
( |
|
self, |
|
|
|
stream, |
|
|
|
errors = 'strict' |
|
) |
| |
Creates a StreamWriter instance.
stream must be a file-like object open for writing
(binary) data.
The StreamWriter 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
'xmlcharrefreplace' - Replace with the appropriate XML
character reference.
'backslashreplace' - Replace with backslashed escape
sequences (only for encoding).
The set of allowed parameter values can be extended via
register_error.
def codecs.StreamWriter.__enter__ |
( |
|
self | ) |
|
def codecs.StreamWriter.__exit__ |
( |
|
self, |
|
|
|
type, |
|
|
|
value, |
|
|
|
tb |
|
) |
| |
def codecs.StreamWriter.__getattr__ |
( |
|
self, |
|
|
|
name, |
|
|
|
getattr = getattr |
|
) |
| |
Inherit all other methods from the underlying stream.
def codecs.StreamWriter.reset |
( |
|
self | ) |
|
Flushes and resets the codec buffers used for keeping state.
Calling this method should ensure that the data on the
output is put into a clean state, that allows appending
of new fresh data without having to rescan the whole
stream to recover state.
def codecs.StreamWriter.seek |
( |
|
self, |
|
|
|
offset, |
|
|
|
whence = 0 |
|
) |
| |
def codecs.StreamWriter.write |
( |
|
self, |
|
|
|
object |
|
) |
| |
Writes the object's contents encoded to self.stream.
def codecs.StreamWriter.writelines |
( |
|
self, |
|
|
|
list |
|
) |
| |
Writes the concatenated list of strings to the stream
using .write().
codecs.StreamWriter.errors |
codecs.StreamWriter.stream |
The documentation for this class was generated from the following file:
Copyright 2014 Google Inc. All rights reserved.