diff options
Diffstat (limited to 'Doc/library/compileall.rst')
-rw-r--r-- | Doc/library/compileall.rst | 53 |
1 files changed, 44 insertions, 9 deletions
diff --git a/Doc/library/compileall.rst b/Doc/library/compileall.rst index 86f60fb..ac0feb7 100644 --- a/Doc/library/compileall.rst +++ b/Doc/library/compileall.rst @@ -11,14 +11,51 @@ libraries. These functions compile Python source files in a directory tree, allowing users without permission to write to the libraries to take advantage of cached byte-code files. -This module may also be used as a script (using the :option:`-m` Python flag) to -compile Python sources. Directories to recursively traverse (passing -:option:`-l` stops the recursive behavior) for sources are listed on the command -line. If no arguments are given, the invocation is equivalent to ``-l -sys.path``. Printing lists of the files compiled can be disabled with the -:option:`-q` flag. In addition, the :option:`-x` option takes a regular -expression argument. All files that match the expression will be skipped. +Command-line use +---------------- + +This module can work as a script (using :program:`python -m compileall`) to +compile Python sources. + +.. program:: compileall + +.. cmdoption:: [directory|file]... + + Positional arguments are files to compile or directories that contain + source files, traversed recursively. If no argument is given, behave as if + the command line was ``-l <directories from sys.path>``. + +.. cmdoption:: -l + + Do not recurse. + +.. cmdoption:: -f + + Force rebuild even if timestamps are up-to-date. + +.. cmdoption:: -q + + Do not print the list of files compiled. + +.. cmdoption:: -d destdir + + Purported directory name for error messages. + +.. cmdoption:: -x regex + + Skip files with a full path that matches given regular expression. + +.. cmdoption:: -i list + + Expand list with its content (file and directory names). + +.. versionadded:: 2.7 + The ``-i`` option. + + +Public functions +---------------- .. function:: compile_dir(dir[, maxlevels[, ddir[, force[, rx[, quiet]]]]]) @@ -35,7 +72,6 @@ expression argument. All files that match the expression will be skipped. If *quiet* is true, nothing is printed to the standard output in normal operation. - .. function:: compile_path([skip_curdir[, maxlevels[, force]]]) Byte-compile all the :file:`.py` files found along ``sys.path``. If @@ -59,4 +95,3 @@ subdirectory and all its subdirectories:: Module :mod:`py_compile` Byte-compile a single source file. - |