blob: 64e8a9e623c44ce5487e06dea80ca5c978dcdfea [file] [log] [blame]
Fred Drakee72e1e01998-08-11 15:46:42 +00001% Documentation based on module docstrings, by Fred L. Drake, Jr.
2% <fdrake@acm.org>
3
4\section{\module{compileall} ---
5 Byte-compile Python libraries.}
6
7\declaremodule{standard}{compileall}
8
9\modulesynopsis{Tools for byte-compiling all Python source files in a
10directory tree.}
11
12
13This module provides some utility functions to support installing
14Python libraries. These functions compile Python source files in a
15directory tree, allowing users without permission to write to the
16libraries to take advantage of cached byte-code files.
17
18The source file for this module may also be used as a script to
19compile Python sources in directories named on the command line or in
20\code{sys.path}.
21
22
23\begin{funcdesc}{compile_dir}{dir\optional{, maxlevels\optional{, ddir}}}
24 Recursively descend the directory tree named by \var{dir}, compiling
25 all \file{.py} files along the way. The \var{maxlevels} parameter
26 is used to limit the depth of the recursion; it defaults to
27 \code{10}. If \var{ddir} is given, it is used as the base path from
28 which the filenames used in error messages will be generated.
29\end{funcdesc}
30
31\begin{funcdesc}{compile_path}{\optional{skip_curdir\optional{, maxlevels}}}
32 Byte-compile all the \file{.py} files found along \code{sys.path}.
33 If \var{skip_curdir} is true (the default), the current directory is
34 not included in the search. The \var{maxlevels} parameter defaults
35 to \code{0} and is passed to the \function{compile_dir()} function.
36\end{funcdesc}
37
38
39\begin{seealso}
40 \seemodule[pycompile]{py_compile}{Byte-compile a single source file.}
41\end{seealso}