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

Python code coverage for Lib/encodings/mbcs.py

#countcontent
1n/a""" Python 'mbcs' Codec for Windows
2n/a
3n/a
4n/aCloned by Mark Hammond (mhammond@skippinet.com.au) from ascii.py,
5n/awhich was written by Marc-Andre Lemburg (mal@lemburg.com).
6n/a
7n/a(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
8n/a
9n/a"""
10n/a# Import them explicitly to cause an ImportError
11n/a# on non-Windows systems
12n/afrom codecs import mbcs_encode, mbcs_decode
13n/a# for IncrementalDecoder, IncrementalEncoder, ...
14n/aimport codecs
15n/a
16n/a### Codec APIs
17n/a
18n/aencode = mbcs_encode
19n/a
20n/adef decode(input, errors='strict'):
21n/a return mbcs_decode(input, errors, True)
22n/a
23n/aclass IncrementalEncoder(codecs.IncrementalEncoder):
24n/a def encode(self, input, final=False):
25n/a return mbcs_encode(input, self.errors)[0]
26n/a
27n/aclass IncrementalDecoder(codecs.BufferedIncrementalDecoder):
28n/a _buffer_decode = mbcs_decode
29n/a
30n/aclass StreamWriter(codecs.StreamWriter):
31n/a encode = mbcs_encode
32n/a
33n/aclass StreamReader(codecs.StreamReader):
34n/a decode = mbcs_decode
35n/a
36n/a### encodings module API
37n/a
38n/adef getregentry():
39n/a return codecs.CodecInfo(
40n/a name='mbcs',
41n/a encode=encode,
42n/a decode=decode,
43n/a incrementalencoder=IncrementalEncoder,
44n/a incrementaldecoder=IncrementalDecoder,
45n/a streamreader=StreamReader,
46n/a streamwriter=StreamWriter,
47n/a )