~malept/ubuntu/lucid/python2.6/dev-dependency-fix

« back to all changes in this revision

Viewing changes to Doc/library/tabnanny.rst

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-02-13 12:51:00 UTC
  • Revision ID: james.westby@ubuntu.com-20090213125100-uufgcb9yeqzujpqw
Tags: upstream-2.6.1
ImportĀ upstreamĀ versionĀ 2.6.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
:mod:`tabnanny` --- Detection of ambiguous indentation
 
3
======================================================
 
4
 
 
5
.. module:: tabnanny
 
6
   :synopsis: Tool for detecting white space related problems in Python source files in a
 
7
              directory tree.
 
8
.. moduleauthor:: Tim Peters <tim_one@users.sourceforge.net>
 
9
.. sectionauthor:: Peter Funk <pf@artcom-gmbh.de>
 
10
 
 
11
.. rudimentary documentation based on module comments
 
12
 
 
13
For the time being this module is intended to be called as a script. However it
 
14
is possible to import it into an IDE and use the function :func:`check`
 
15
described below.
 
16
 
 
17
.. warning::
 
18
 
 
19
   The API provided by this module is likely to change  in future releases; such
 
20
   changes may not be backward compatible.
 
21
 
 
22
 
 
23
.. function:: check(file_or_dir)
 
24
 
 
25
   If *file_or_dir* is a directory and not a symbolic link, then recursively
 
26
   descend the directory tree named by *file_or_dir*, checking all :file:`.py`
 
27
   files along the way.  If *file_or_dir* is an ordinary Python source file, it is
 
28
   checked for whitespace related problems.  The diagnostic messages are written to
 
29
   standard output using the print statement.
 
30
 
 
31
 
 
32
.. data:: verbose
 
33
 
 
34
   Flag indicating whether to print verbose messages. This is incremented by the
 
35
   ``-v`` option if called as a script.
 
36
 
 
37
 
 
38
.. data:: filename_only
 
39
 
 
40
   Flag indicating whether to print only the filenames of files containing
 
41
   whitespace related problems.  This is set to true by the ``-q`` option if called
 
42
   as a script.
 
43
 
 
44
 
 
45
.. exception:: NannyNag
 
46
 
 
47
   Raised by :func:`tokeneater` if detecting an ambiguous indent. Captured and
 
48
   handled in :func:`check`.
 
49
 
 
50
 
 
51
.. function:: tokeneater(type, token, start, end, line)
 
52
 
 
53
   This function is used by :func:`check` as a callback parameter to the function
 
54
   :func:`tokenize.tokenize`.
 
55
 
 
56
.. XXX document errprint, format_witnesses, Whitespace, check_equal, indents,
 
57
   reset_globals
 
58
 
 
59
 
 
60
.. seealso::
 
61
 
 
62
   Module :mod:`tokenize`
 
63
      Lexical scanner for Python source code.