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

Python code coverage for Lib/encodings/oem.py

#countcontent
1n/a""" Python 'oem' Codec for Windows
2n/a
3n/a"""
4n/a# Import them explicitly to cause an ImportError
5n/a# on non-Windows systems
6n/afrom codecs import oem_encode, oem_decode
7n/a# for IncrementalDecoder, IncrementalEncoder, ...
8n/aimport codecs
9n/a
10n/a### Codec APIs
11n/a
12n/aencode = oem_encode
13n/a
14n/adef decode(input, errors='strict'):
15n/a return oem_decode(input, errors, True)
16n/a
17n/aclass IncrementalEncoder(codecs.IncrementalEncoder):
18n/a def encode(self, input, final=False):
19n/a return oem_encode(input, self.errors)[0]
20n/a
21n/aclass IncrementalDecoder(codecs.BufferedIncrementalDecoder):
22n/a _buffer_decode = oem_decode
23n/a
24n/aclass StreamWriter(codecs.StreamWriter):
25n/a encode = oem_encode
26n/a
27n/aclass StreamReader(codecs.StreamReader):
28n/a decode = oem_decode
29n/a
30n/a### encodings module API
31n/a
32n/adef getregentry():
33n/a return codecs.CodecInfo(
34n/a name='oem',
35n/a encode=encode,
36n/a decode=decode,
37n/a incrementalencoder=IncrementalEncoder,
38n/a incrementaldecoder=IncrementalDecoder,
39n/a streamreader=StreamReader,
40n/a streamwriter=StreamWriter,
41n/a )