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

Python code coverage for Lib/encodings/unicode_escape.py

#countcontent
1n/a""" Python 'unicode-escape' 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.unicode_escape_encode
18n/a decode = codecs.unicode_escape_decode
19n/a
20n/aclass IncrementalEncoder(codecs.IncrementalEncoder):
21n/a def encode(self, input, final=False):
22n/a return codecs.unicode_escape_encode(input, self.errors)[0]
23n/a
24n/aclass IncrementalDecoder(codecs.IncrementalDecoder):
25n/a def decode(self, input, final=False):
26n/a return codecs.unicode_escape_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/a### encodings module API
35n/a
36n/adef getregentry():
37n/a return codecs.CodecInfo(
38n/a name='unicode-escape',
39n/a encode=Codec.encode,
40n/a decode=Codec.decode,
41n/a incrementalencoder=IncrementalEncoder,
42n/a incrementaldecoder=IncrementalDecoder,
43n/a streamwriter=StreamWriter,
44n/a streamreader=StreamReader,
45n/a )