Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes
encodings.charmap.StreamWriter Class Reference
Inheritance diagram for encodings.charmap.StreamWriter:
Inheritance graph
[legend]
Collaboration diagram for encodings.charmap.StreamWriter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def encode
def decode
def write
def writelines
def reset
def seek
def __getattr__
def __enter__
def __exit__
def decode

Public Attributes

 mapping
 stream
 errors

Static Public Attributes

 encode = codecs.charmap_encode
 decode = codecs.charmap_decode

Detailed Description

Definition at line 40 of file charmap.py.


Constructor & Destructor Documentation

def encodings.charmap.StreamWriter.__init__ (   self,
  stream,
  errors = 'strict',
  mapping = None 
)

Definition at line 42 of file charmap.py.

00042 
00043     def __init__(self,stream,errors='strict',mapping=None):
00044         codecs.StreamWriter.__init__(self,stream,errors)
00045         self.mapping = mapping

Here is the call graph for this function:

Here is the caller graph for this function:


Member Function Documentation

def codecs.StreamWriter.__enter__ (   self) [inherited]

Definition at line 389 of file codecs.py.

00389 
00390     def __enter__(self):
00391         return self

def codecs.StreamWriter.__exit__ (   self,
  type,
  value,
  tb 
) [inherited]

Definition at line 392 of file codecs.py.

00392 
00393     def __exit__(self, type, value, tb):
00394         self.stream.close()

Here is the caller graph for this function:

def codecs.StreamWriter.__getattr__ (   self,
  name,
  getattr = getattr 
) [inherited]
Inherit all other methods from the underlying stream.

Definition at line 383 of file codecs.py.

00383 
00384                     getattr=getattr):
00385 
00386         """ Inherit all other methods from the underlying stream.
00387         """
00388         return getattr(self.stream, name)

Here is the call graph for this function:

def codecs.Codec.decode (   self,
  input,
  errors = 'strict' 
) [inherited]
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.

Reimplemented in codecs.StreamReader, encodings.punycode.Codec, encodings.idna.Codec, encodings.utf_16.StreamReader, encodings.utf_32.StreamReader, encodings.utf_8_sig.StreamReader, encodings.uu_codec.Codec, encodings.charmap.StreamReader, encodings.quopri_codec.Codec, encodings.bz2_codec.Codec, encodings.base64_codec.Codec, encodings.hex_codec.Codec, encodings.zlib_codec.Codec, encodings.undefined.Codec, encodings.hp_roman8.Codec, encodings.mac_latin2.Codec, encodings.ptcp154.Codec, encodings.rot_13.Codec, test.testcodec.Codec, encodings.cp720.Codec, encodings.palmos.Codec, encodings.cp037.Codec, encodings.cp1006.Codec, encodings.cp1026.Codec, encodings.cp1140.Codec, encodings.cp1250.Codec, encodings.cp1251.Codec, encodings.cp1252.Codec, encodings.cp1253.Codec, encodings.cp1254.Codec, encodings.cp1255.Codec, encodings.cp1256.Codec, encodings.cp1257.Codec, encodings.cp1258.Codec, encodings.cp424.Codec, encodings.cp437.Codec, encodings.cp500.Codec, encodings.cp737.Codec, encodings.cp775.Codec, encodings.cp850.Codec, encodings.cp852.Codec, encodings.cp855.Codec, encodings.cp856.Codec, encodings.cp857.Codec, encodings.cp858.Codec, encodings.cp860.Codec, encodings.cp861.Codec, encodings.cp862.Codec, encodings.cp863.Codec, encodings.cp864.Codec, encodings.cp865.Codec, encodings.cp866.Codec, encodings.cp869.Codec, encodings.cp874.Codec, encodings.cp875.Codec, encodings.iso8859_1.Codec, encodings.iso8859_10.Codec, encodings.iso8859_11.Codec, encodings.iso8859_13.Codec, encodings.iso8859_14.Codec, encodings.iso8859_15.Codec, encodings.iso8859_16.Codec, encodings.iso8859_2.Codec, encodings.iso8859_3.Codec, encodings.iso8859_4.Codec, encodings.iso8859_5.Codec, encodings.iso8859_6.Codec, encodings.iso8859_7.Codec, encodings.iso8859_8.Codec, encodings.iso8859_9.Codec, encodings.koi8_r.Codec, encodings.koi8_u.Codec, encodings.mac_arabic.Codec, encodings.mac_centeuro.Codec, encodings.mac_croatian.Codec, encodings.mac_cyrillic.Codec, encodings.mac_farsi.Codec, encodings.mac_greek.Codec, encodings.mac_iceland.Codec, encodings.mac_roman.Codec, encodings.mac_romanian.Codec, encodings.mac_turkish.Codec, and encodings.tis_620.Codec.

Definition at line 135 of file codecs.py.

00135 
00136     def decode(self, input, errors='strict'):
00137 
00138         """ Decodes the object input and returns a tuple (output
00139             object, length consumed).
00140 
00141             input must be an object which provides the bf_getreadbuf
00142             buffer slot. Python strings, buffer objects and memory
00143             mapped files are examples of objects providing this slot.
00144 
00145             errors defines the error handling to apply. It defaults to
00146             'strict' handling.
00147 
00148             The method may not store state in the Codec instance. Use
00149             StreamCodec for codecs which have to keep state in order to
00150             make encoding/decoding efficient.
00151 
00152             The decoder must be able to handle zero length input and
00153             return an empty object of the output object type in this
00154             situation.
00155 
00156         """
00157         raise NotImplementedError

Here is the caller graph for this function:

def codecs.Codec.decode (   self,
  input,
  errors = 'strict' 
) [inherited]
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.

Reimplemented in codecs.StreamReader, encodings.punycode.Codec, encodings.idna.Codec, encodings.utf_16.StreamReader, encodings.utf_32.StreamReader, encodings.utf_8_sig.StreamReader, encodings.uu_codec.Codec, encodings.charmap.StreamReader, encodings.quopri_codec.Codec, encodings.bz2_codec.Codec, encodings.base64_codec.Codec, encodings.hex_codec.Codec, encodings.zlib_codec.Codec, encodings.undefined.Codec, encodings.hp_roman8.Codec, encodings.mac_latin2.Codec, encodings.ptcp154.Codec, encodings.rot_13.Codec, test.testcodec.Codec, encodings.cp720.Codec, encodings.palmos.Codec, encodings.cp037.Codec, encodings.cp1006.Codec, encodings.cp1026.Codec, encodings.cp1140.Codec, encodings.cp1250.Codec, encodings.cp1251.Codec, encodings.cp1252.Codec, encodings.cp1253.Codec, encodings.cp1254.Codec, encodings.cp1255.Codec, encodings.cp1256.Codec, encodings.cp1257.Codec, encodings.cp1258.Codec, encodings.cp424.Codec, encodings.cp437.Codec, encodings.cp500.Codec, encodings.cp737.Codec, encodings.cp775.Codec, encodings.cp850.Codec, encodings.cp852.Codec, encodings.cp855.Codec, encodings.cp856.Codec, encodings.cp857.Codec, encodings.cp858.Codec, encodings.cp860.Codec, encodings.cp861.Codec, encodings.cp862.Codec, encodings.cp863.Codec, encodings.cp864.Codec, encodings.cp865.Codec, encodings.cp866.Codec, encodings.cp869.Codec, encodings.cp874.Codec, encodings.cp875.Codec, encodings.iso8859_1.Codec, encodings.iso8859_10.Codec, encodings.iso8859_11.Codec, encodings.iso8859_13.Codec, encodings.iso8859_14.Codec, encodings.iso8859_15.Codec, encodings.iso8859_16.Codec, encodings.iso8859_2.Codec, encodings.iso8859_3.Codec, encodings.iso8859_4.Codec, encodings.iso8859_5.Codec, encodings.iso8859_6.Codec, encodings.iso8859_7.Codec, encodings.iso8859_8.Codec, encodings.iso8859_9.Codec, encodings.koi8_r.Codec, encodings.koi8_u.Codec, encodings.mac_arabic.Codec, encodings.mac_centeuro.Codec, encodings.mac_croatian.Codec, encodings.mac_cyrillic.Codec, encodings.mac_farsi.Codec, encodings.mac_greek.Codec, encodings.mac_iceland.Codec, encodings.mac_roman.Codec, encodings.mac_romanian.Codec, encodings.mac_turkish.Codec, and encodings.tis_620.Codec.

Definition at line 135 of file codecs.py.

00135 
00136     def decode(self, input, errors='strict'):
00137 
00138         """ Decodes the object input and returns a tuple (output
00139             object, length consumed).
00140 
00141             input must be an object which provides the bf_getreadbuf
00142             buffer slot. Python strings, buffer objects and memory
00143             mapped files are examples of objects providing this slot.
00144 
00145             errors defines the error handling to apply. It defaults to
00146             'strict' handling.
00147 
00148             The method may not store state in the Codec instance. Use
00149             StreamCodec for codecs which have to keep state in order to
00150             make encoding/decoding efficient.
00151 
00152             The decoder must be able to handle zero length input and
00153             return an empty object of the output object type in this
00154             situation.
00155 
00156         """
00157         raise NotImplementedError

Here is the caller graph for this function:

def encodings.charmap.StreamWriter.encode (   self,
  input,
  errors = 'strict' 
)
Encodes the object input and returns a tuple (output
    object, length consumed).

    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 encoder must be able to handle zero length input and
    return an empty object of the output object type in this
    situation.

Reimplemented from codecs.Codec.

Definition at line 46 of file charmap.py.

00046 
00047     def encode(self,input,errors='strict'):
00048         return Codec.encode(input,errors,self.mapping)

Here is the caller graph for this function:

def codecs.StreamWriter.reset (   self) [inherited]
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.

Reimplemented in encodings.utf_16.StreamWriter, encodings.utf_32.StreamWriter, and encodings.utf_8_sig.StreamWriter.

Definition at line 365 of file codecs.py.

00365 
00366     def reset(self):
00367 
00368         """ Flushes and resets the codec buffers used for keeping state.
00369 
00370             Calling this method should ensure that the data on the
00371             output is put into a clean state, that allows appending
00372             of new fresh data without having to rescan the whole
00373             stream to recover state.
00374 
00375         """
00376         pass

Here is the caller graph for this function:

def codecs.StreamWriter.seek (   self,
  offset,
  whence = 0 
) [inherited]

Definition at line 377 of file codecs.py.

00377 
00378     def seek(self, offset, whence=0):
00379         self.stream.seek(offset, whence)
00380         if whence == 0 and offset == 0:
00381             self.reset()

Here is the call graph for this function:

Here is the caller graph for this function:

def codecs.StreamWriter.write (   self,
  object 
) [inherited]
Writes the object's contents encoded to self.stream.

Definition at line 351 of file codecs.py.

00351 
00352     def write(self, object):
00353 
00354         """ Writes the object's contents encoded to self.stream.
00355         """
00356         data, consumed = self.encode(object, self.errors)
00357         self.stream.write(data)

Here is the call graph for this function:

def codecs.StreamWriter.writelines (   self,
  list 
) [inherited]
Writes the concatenated list of strings to the stream
    using .write().

Definition at line 358 of file codecs.py.

00358 
00359     def writelines(self, list):
00360 
00361         """ Writes the concatenated list of strings to the stream
00362             using .write().
00363         """
00364         self.write(''.join(list))

Here is the call graph for this function:


Member Data Documentation

Definition at line 22 of file charmap.py.

Definition at line 21 of file charmap.py.

Definition at line 349 of file codecs.py.

Definition at line 44 of file charmap.py.

Definition at line 348 of file codecs.py.


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