0001 # 0002 # shift_jis_2004.py: Python Unicode Codec for SHIFT_JIS_2004 0003 # 0004 # Written by Hye-Shik Chang <perky@FreeBSD.org> 0005 # $CJKCodecs: shift_jis_2004.py,v 1.1 2004/07/07 16:18:25 perky Exp $ 0006 # 0007 0008 import _codecs_jp, codecs 0009 0010 codec = _codecs_jp.getcodec('shift_jis_2004') 0011 0012 class Codec(codecs.Codec): 0013 encode = codec.encode 0014 decode = codec.decode 0015 0016 class StreamReader(Codec, codecs.StreamReader): 0017 def __init__(self, stream, errors='strict'): 0018 codecs.StreamReader.__init__(self, stream, errors) 0019 __codec = codec.StreamReader(stream, errors) 0020 self.read = __codec.read 0021 self.readline = __codec.readline 0022 self.readlines = __codec.readlines 0023 self.reset = __codec.reset 0024 0025 class StreamWriter(Codec, codecs.StreamWriter): 0026 def __init__(self, stream, errors='strict'): 0027 codecs.StreamWriter.__init__(self, stream, errors) 0028 __codec = codec.StreamWriter(stream, errors) 0029 self.write = __codec.write 0030 self.writelines = __codec.writelines 0031 self.reset = __codec.reset 0032 0033 def getregentry(): 0034 return (codec.encode, codec.decode, StreamReader, StreamWriter) 0035
Generated by PyXR 0.9.4