]> granicus.if.org Git - python/commitdiff
Docs and News item for the codecs.py additions.
authorMarc-André Lemburg <mal@egenix.com>
Wed, 19 Sep 2001 11:33:31 +0000 (11:33 +0000)
committerMarc-André Lemburg <mal@egenix.com>
Wed, 19 Sep 2001 11:33:31 +0000 (11:33 +0000)
Doc/lib/libcodecs.tex
Misc/NEWS

index acbed9a1641aa950bdae3db5a0e237799fe7ea3f..844f6ec7b8691e13df563433bcf3c54baed93897 100644 (file)
@@ -63,6 +63,38 @@ is found, a \exception{LookupError} is raised. Otherwise, the codecs
 tuple is stored in the cache and returned to the caller.
 \end{funcdesc}
 
+To simply access to the various codecs, the module provides these
+additional functions which use \function{lookup()} for the codec
+lookup:
+
+\begin{funcdesc}{getencoder}{encoding}
+Lookup up the codec for the given encoding and return its encoder
+function.
+
+Raises a \exception{LookupError} in case the encoding cannot be found.
+\end{funcdesc}
+
+\begin{funcdesc}{getdecoder}{encoding}
+Lookup up the codec for the given encoding and return its decoder
+function.
+
+Raises a \exception{LookupError} in case the encoding cannot be found.
+\end{funcdesc}
+
+\begin{funcdesc}{getreader}{encoding}
+Lookup up the codec for the given encoding and return its StreamReader
+class or factory function.
+
+Raises a \exception{LookupError} in case the encoding cannot be found.
+\end{funcdesc}
+
+\begin{funcdesc}{getwriter}{encoding}
+Lookup up the codec for the given encoding and return its StreamWriter
+class or factory function.
+
+Raises a \exception{LookupError} in case the encoding cannot be found.
+\end{funcdesc}
+
 To simplify working with encoded files or stream, the module
 also defines these utility functions:
 
index aca9b8bf776cc1c2a6f4c001ef8d93770d32b395..f1037054d1c9211df65eb43da162fea158ea1c43 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -34,6 +34,10 @@ Core
 
 Library
 
+- The codecs module has grown four new helper APIs to access
+  builtin codecs: getencoder(), getdecoder(), getreader(),
+  getwriter().
+
 - SimpleXMLRPCServer: a new module (based upon SimpleHTMLServer)
   simplifies writing XML RPC servers.