ยปCore Development>Code coverage>Lib/encodings/ascii.py

Python code coverage for Lib/encodings/ascii.py

#countcontent
1n/a""" Python 'ascii' Codec
2n/a
3n/a
4n/aWritten by Marc-Andre Lemburg (mal@lemburg.com).
5n/a
6n/a(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
7n/a
8n/a"""
9n/aimport codecs
10n/a
11n/a### Codec APIs
12n/a
13n/aclass Codec(codecs.Codec):
14n/a
15n/a # Note: Binding these as C functions will result in the class not
16n/a # converting them to methods. This is intended.
17n/a encode = codecs.ascii_encode
18n/a decode = codecs.ascii_decode
19n/a
20n/aclass IncrementalEncoder(codecs.IncrementalEncoder):
21n/a def encode(self, input, final=False):
22n/a return codecs.ascii_encode(input, self.errors)[0]
23n/a
24n/aclass IncrementalDecoder(codecs.IncrementalDecoder):
25n/a def decode(self, input, final=False):
26n/a return codecs.ascii_decode(input, self.errors)[0]
27n/a
28n/aclass StreamWriter(Codec,codecs.StreamWriter):
29n/a pass
30n/a
31n/aclass StreamReader(Codec,codecs.StreamReader):
32n/a pass
33n/a
34n/aclass StreamConverter(StreamWriter,StreamReader):
35n/a
36n/a encode = codecs.ascii_decode
37n/a decode = codecs.ascii_encode
38n/a
39n/a### encodings module API
40n/a
41n/adef getregentry():
42n/a return codecs.CodecInfo(
43n/a name='ascii',
44n/a encode=Codec.encode,
45n/a decode=Codec.decode,
46n/a incrementalencoder=IncrementalEncoder,
47n/a incrementaldecoder=IncrementalDecoder,
48n/a streamwriter=StreamWriter,
49n/a streamreader=StreamReader,
50n/a )