Marc-André Lemburg | 35b0cb0 | 2001-09-20 12:56:14 +0000 | [diff] [blame] | 1 | """ Python 'utf-7' Codec |
| 2 | |
| 3 | Written by Brian Quinlan (brian@sweetapp.com). |
| 4 | """ |
| 5 | import codecs |
| 6 | |
| 7 | ### Codec APIs |
| 8 | |
| 9 | class Codec(codecs.Codec): |
| 10 | |
| 11 | # Note: Binding these as C functions will result in the class not |
| 12 | # converting them to methods. This is intended. |
| 13 | encode = codecs.utf_7_encode |
| 14 | decode = codecs.utf_7_decode |
| 15 | |
| 16 | class StreamWriter(Codec,codecs.StreamWriter): |
| 17 | pass |
| 18 | |
| 19 | class StreamReader(Codec,codecs.StreamReader): |
| 20 | pass |
| 21 | |
| 22 | ### encodings module API |
| 23 | |
| 24 | def getregentry(): |
| 25 | |
| 26 | return (Codec.encode,Codec.decode,StreamReader,StreamWriter) |
| 27 | |