blob: 12b9385b87175f399ae2e8fd5d6855fc1a9f001e [file] [log] [blame]
Fred Drake155348b2000-02-23 15:44:08 +00001\section{\module{tabnanny} ---
2 Detection of ambiguous indentation}
3
4% rudimentary documentation based on module comments, by Peter Funk
5% <pf@artcom-gmbh.de>
6
7\declaremodule{standard}{tabnanny}
8\modulesynopsis{Tool for detecting white space related problems
9 in Python source files in a directory tree.}
Fred Drake42713102003-12-30 16:15:35 +000010\moduleauthor{Tim Peters}{tim_one@users.sourceforge.net}
Fred Drake155348b2000-02-23 15:44:08 +000011\sectionauthor{Peter Funk}{pf@artcom-gmbh.de}
12
13For the time being this module is intended to be called as a script.
14However it is possible to import it into an IDE and use the function
15\function{check()} described below.
16
Fred Drake0aa811c2001-10-20 04:24:09 +000017\warning{The API provided by this module is likely to change
18in future releases; such changes may not be backward compatible.}
Fred Drake155348b2000-02-23 15:44:08 +000019
20\begin{funcdesc}{check}{file_or_dir}
21 If \var{file_or_dir} is a directory and not a symbolic link, then
22 recursively descend the directory tree named by \var{file_or_dir},
23 checking all \file{.py} files along the way. If \var{file_or_dir}
24 is an ordinary Python source file, it is checked for whitespace
25 related problems. The diagnostic messages are written to standard
26 output using the print statement.
27\end{funcdesc}
28
29
30\begin{datadesc}{verbose}
31 Flag indicating whether to print verbose messages.
Neal Norwitzd3dab2b2002-04-05 02:21:09 +000032 This is incremented by the \code{-v} option if called as a script.
Fred Drake155348b2000-02-23 15:44:08 +000033\end{datadesc}
34
35
36\begin{datadesc}{filename_only}
37 Flag indicating whether to print only the filenames of files
38 containing whitespace related problems. This is set to true by the
39 \code{-q} option if called as a script.
40\end{datadesc}
41
42
43\begin{excdesc}{NannyNag}
44 Raised by \function{tokeneater()} if detecting an ambiguous indent.
45 Captured and handled in \function{check()}.
46\end{excdesc}
47
48
49\begin{funcdesc}{tokeneater}{type, token, start, end, line}
50 This function is used by \function{check()} as a callback parameter to
51 the function \function{tokenize.tokenize()}.
52\end{funcdesc}
53
54% XXX FIXME: Document \function{errprint},
55% \function{format_witnesses} \class{Whitespace}
56% check_equal, indents
57% \function{reset_globals}
58
59\begin{seealso}
60 \seemodule{tokenize}{Lexical scanner for Python source code.}
61 % XXX may be add a reference to IDLE?
62\end{seealso}