Clarify how hook_compressed determines how to open a file.

This commit is contained in:
Georg Brandl 2006-02-19 15:20:29 +00:00
parent c98eeede17
commit c3e950cbf3

View file

@ -165,8 +165,9 @@ filtering is disabled when standard input is read.
The two following opening hooks are provided by this module: The two following opening hooks are provided by this module:
\begin{funcdesc}{hook_compressed}{filename, mode} \begin{funcdesc}{hook_compressed}{filename, mode}
Transparently opens files compressed with gzip and bzip2 using Transparently opens files compressed with gzip and bzip2 (recognized
the \module{gzip} and \module{bz2} modules. by the extensions \code{'.gz'} and \code{'.bz2'}) using the \module{gzip}
and \module{bz2} modules as well as normal files.
Usage example: Usage example:
\samp{fi = fileinput.FileInput(openhook=fileinput.hook_compressed)} \samp{fi = fileinput.FileInput(openhook=fileinput.hook_compressed)}