Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 17e33e4

Browse files
committed
[Bug #914375] Crude modulefinder docs, but the module's code is very hard to read and it's not clear which bits are public and which aren't. The module's author should really be doing this (and using docstrings in the code, too)
1 parent 8c47f4a commit 17e33e4

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

Doc/lib/libmodulefinder.tex

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
\section{\module{modulefinder} ---
2+
Find modules used by a script}
3+
\sectionauthor{A.M. Kuchling}{[email protected]}
4+
5+
\declaremodule{standard}{modulefinder}
6+
\modulesynopsis{Find modules used by a script.}
7+
8+
This module provides a \class{ModuleFinder} class that can be used to
9+
determine the set of modules imported by a script.
10+
\code{modulefinder.py} can also be run as a script, giving the
11+
filename of a Python script as its argument, after which a report of
12+
the imported modules will be printed.
13+
14+
\begin{funcdesc}{AddPackagePath}{pkg_name, path}
15+
Record that the package named \var{pkg_name} can be found in the specified \var{path}.
16+
\end{funcdesc}
17+
18+
\begin{funcdesc}{ReplacePackage}{oldname, newname}
19+
Allows specifying that the module named \var{oldname} is in fact
20+
the package named \var{newname}. The most common usage would be
21+
to handle how the \module{_xmlplus} package replaces the \module{xml}
22+
package.
23+
\end{funcdesc}
24+
25+
\begin{classdesc}{ModuleFinder}{\optional{path=None, debug=0, excludes=[], replace_paths=[]}}
26+
27+
This class provides \method{run_script()} and \method{report()}
28+
methods to determine the set of modules imported by a script.
29+
\var{path} can be a list of directories to search for modules; if not
30+
specified, \code{sys.path} is used.
31+
\var{debug} sets the debugging level; higher values make the class print
32+
debugging messages about what it's doing.
33+
\var{excludes} is a list of module names to exclude from the analysis.
34+
\var{replace_paths} is a list of \code{(\var{oldpath}, \var{newpath})}
35+
tuples that will be replaced in module paths.
36+
\end{classdesc}
37+
38+
\begin{methoddesc}[ModuleFinder]{report}{}
39+
Print a report to standard output that lists the modules imported by the script
40+
and their
41+
paths, as well as modules that are missing or seem to be missing.
42+
\end{methoddesc}
43+
44+
\begin{methoddesc}[ModuleFinder]{run_script}{pathname}
45+
Analyze the contents of the \var{pathname} file, which must contain
46+
Python code.
47+
\end{methoddesc}
48+
49+

0 commit comments

Comments
 (0)