~ubuntu-branches/ubuntu/karmic/pypy/karmic

« back to all changes in this revision

Viewing changes to lib-python/modified-2.4.1/encodings/latin_1.py

  • Committer: Bazaar Package Importer
  • Author(s): Alexandre Fayolle
  • Date: 2007-04-13 09:33:09 UTC
  • Revision ID: james.westby@ubuntu.com-20070413093309-yoojh4jcoocu2krz
Tags: upstream-1.0.0
ImportĀ upstreamĀ versionĀ 1.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
""" Python 'latin-1' Codec
 
2
 
 
3
 
 
4
Written by Marc-Andre Lemburg (mal@lemburg.com).
 
5
 
 
6
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
 
7
 
 
8
"""
 
9
import codecs
 
10
 
 
11
### Codec APIs
 
12
 
 
13
class Codec(codecs.Codec):
 
14
 
 
15
    # Note: Binding these as C functions will result in the class not
 
16
    # converting them to methods. This is intended.
 
17
    encode = staticmethod(codecs.latin_1_encode)
 
18
    decode = staticmethod(codecs.latin_1_decode)
 
19
 
 
20
class StreamWriter(Codec,codecs.StreamWriter):
 
21
    pass
 
22
 
 
23
class StreamReader(Codec,codecs.StreamReader):
 
24
    pass
 
25
 
 
26
class StreamConverter(StreamWriter,StreamReader):
 
27
 
 
28
    encode = codecs.latin_1_decode
 
29
    decode = codecs.latin_1_encode
 
30
 
 
31
### encodings module API
 
32
 
 
33
def getregentry():
 
34
 
 
35
    return (Codec.encode,Codec.decode,StreamReader,StreamWriter)