1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
<html xmlns="http://www.w3.org/1999/xhtml">
7
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9
<title>32.8. tabnanny — Detection of ambiguous indentation — Python 3.5.1 documentation</title>
11
<link rel="stylesheet" href="../_static/pydoctheme.css" type="text/css" />
12
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
14
<script type="text/javascript">
15
var DOCUMENTATION_OPTIONS = {
18
COLLAPSE_INDEX: false,
23
<script type="text/javascript" src="../_static/jquery.js"></script>
24
<script type="text/javascript" src="../_static/underscore.js"></script>
25
<script type="text/javascript" src="../_static/doctools.js"></script>
26
<script type="text/javascript" src="../_static/sidebar.js"></script>
27
<link rel="search" type="application/opensearchdescription+xml"
28
title="Search within Python 3.5.1 documentation"
29
href="../_static/opensearch.xml"/>
30
<link rel="author" title="About these documents" href="../about.html" />
31
<link rel="copyright" title="Copyright" href="../copyright.html" />
32
<link rel="top" title="Python 3.5.1 documentation" href="../contents.html" />
33
<link rel="up" title="32. Python Language Services" href="language.html" />
34
<link rel="next" title="32.9. pyclbr — Python class browser support" href="pyclbr.html" />
35
<link rel="prev" title="32.7. tokenize — Tokenizer for Python source" href="tokenize.html" />
36
<link rel="shortcut icon" type="image/png" href="../_static/py.png" />
37
<script type="text/javascript" src="../_static/copybutton.js"></script>
38
<script type="text/javascript" src="../_static/version_switch.js"></script>
43
<body role="document">
44
<div class="related" role="navigation" aria-label="related navigation">
47
<li class="right" style="margin-right: 10px">
48
<a href="../genindex.html" title="General Index"
49
accesskey="I">index</a></li>
51
<a href="../py-modindex.html" title="Python Module Index"
54
<a href="pyclbr.html" title="32.9. pyclbr — Python class browser support"
55
accesskey="N">next</a> |</li>
57
<a href="tokenize.html" title="32.7. tokenize — Tokenizer for Python source"
58
accesskey="P">previous</a> |</li>
59
<li><img src="../_static/py.png" alt=""
60
style="vertical-align: middle; margin-top: -1px"/></li>
61
<li><a href="https://www.python.org/">Python</a> »</li>
63
<span class="version_switcher_placeholder">3.5.1</span>
64
<a href="../index.html">Documentation </a> »
67
<li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> »</li>
68
<li class="nav-item nav-item-2"><a href="language.html" accesskey="U">32. Python Language Services</a> »</li>
72
<div class="document">
73
<div class="documentwrapper">
74
<div class="bodywrapper">
75
<div class="body" role="main">
77
<div class="section" id="module-tabnanny">
78
<span id="tabnanny-detection-of-ambiguous-indentation"></span><h1>32.8. <a class="reference internal" href="#module-tabnanny" title="tabnanny: Tool for detecting white space related problems in Python source files in a directory tree."><code class="xref py py-mod docutils literal"><span class="pre">tabnanny</span></code></a> — Detection of ambiguous indentation<a class="headerlink" href="#module-tabnanny" title="Permalink to this headline">¶</a></h1>
79
<p><strong>Source code:</strong> <a class="reference external" href="https://hg.python.org/cpython/file/3.5/Lib/tabnanny.py">Lib/tabnanny.py</a></p>
80
<hr class="docutils" />
81
<p>For the time being this module is intended to be called as a script. However it
82
is possible to import it into an IDE and use the function <a class="reference internal" href="#tabnanny.check" title="tabnanny.check"><code class="xref py py-func docutils literal"><span class="pre">check()</span></code></a>
84
<div class="admonition note">
85
<p class="first admonition-title">Note</p>
86
<p class="last">The API provided by this module is likely to change in future releases; such
87
changes may not be backward compatible.</p>
90
<dt id="tabnanny.check">
91
<code class="descclassname">tabnanny.</code><code class="descname">check</code><span class="sig-paren">(</span><em>file_or_dir</em><span class="sig-paren">)</span><a class="headerlink" href="#tabnanny.check" title="Permalink to this definition">¶</a></dt>
92
<dd><p>If <em>file_or_dir</em> is a directory and not a symbolic link, then recursively
93
descend the directory tree named by <em>file_or_dir</em>, checking all <code class="file docutils literal"><span class="pre">.py</span></code>
94
files along the way. If <em>file_or_dir</em> is an ordinary Python source file, it
95
is checked for whitespace related problems. The diagnostic messages are
96
written to standard output using the <a class="reference internal" href="functions.html#print" title="print"><code class="xref py py-func docutils literal"><span class="pre">print()</span></code></a> function.</p>
100
<dt id="tabnanny.verbose">
101
<code class="descclassname">tabnanny.</code><code class="descname">verbose</code><a class="headerlink" href="#tabnanny.verbose" title="Permalink to this definition">¶</a></dt>
102
<dd><p>Flag indicating whether to print verbose messages. This is incremented by the
103
<code class="docutils literal"><span class="pre">-v</span></code> option if called as a script.</p>
107
<dt id="tabnanny.filename_only">
108
<code class="descclassname">tabnanny.</code><code class="descname">filename_only</code><a class="headerlink" href="#tabnanny.filename_only" title="Permalink to this definition">¶</a></dt>
109
<dd><p>Flag indicating whether to print only the filenames of files containing
110
whitespace related problems. This is set to true by the <code class="docutils literal"><span class="pre">-q</span></code> option if called
114
<dl class="exception">
115
<dt id="tabnanny.NannyNag">
116
<em class="property">exception </em><code class="descclassname">tabnanny.</code><code class="descname">NannyNag</code><a class="headerlink" href="#tabnanny.NannyNag" title="Permalink to this definition">¶</a></dt>
117
<dd><p>Raised by <a class="reference internal" href="#tabnanny.tokeneater" title="tabnanny.tokeneater"><code class="xref py py-func docutils literal"><span class="pre">tokeneater()</span></code></a> if detecting an ambiguous indent. Captured and
118
handled in <a class="reference internal" href="#tabnanny.check" title="tabnanny.check"><code class="xref py py-func docutils literal"><span class="pre">check()</span></code></a>.</p>
121
<dl class="function">
122
<dt id="tabnanny.tokeneater">
123
<code class="descclassname">tabnanny.</code><code class="descname">tokeneater</code><span class="sig-paren">(</span><em>type</em>, <em>token</em>, <em>start</em>, <em>end</em>, <em>line</em><span class="sig-paren">)</span><a class="headerlink" href="#tabnanny.tokeneater" title="Permalink to this definition">¶</a></dt>
124
<dd><p>This function is used by <a class="reference internal" href="#tabnanny.check" title="tabnanny.check"><code class="xref py py-func docutils literal"><span class="pre">check()</span></code></a> as a callback parameter to the function
125
<a class="reference internal" href="tokenize.html#tokenize.tokenize" title="tokenize.tokenize"><code class="xref py py-func docutils literal"><span class="pre">tokenize.tokenize()</span></code></a>.</p>
128
<div class="admonition seealso">
129
<p class="first admonition-title">See also</p>
130
<dl class="last docutils">
131
<dt>Module <a class="reference internal" href="tokenize.html#module-tokenize" title="tokenize: Lexical scanner for Python source code."><code class="xref py py-mod docutils literal"><span class="pre">tokenize</span></code></a></dt>
132
<dd>Lexical scanner for Python source code.</dd>
141
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
142
<div class="sphinxsidebarwrapper">
143
<h4>Previous topic</h4>
144
<p class="topless"><a href="tokenize.html"
145
title="previous chapter">32.7. <code class="docutils literal"><span class="pre">tokenize</span></code> — Tokenizer for Python source</a></p>
147
<p class="topless"><a href="pyclbr.html"
148
title="next chapter">32.9. <code class="docutils literal"><span class="pre">pyclbr</span></code> — Python class browser support</a></p>
150
<ul class="this-page-menu">
151
<li><a href="../bugs.html">Report a Bug</a></li>
152
<li><a href="../_sources/library/tabnanny.txt"
153
rel="nofollow">Show Source</a></li>
156
<div id="searchbox" style="display: none" role="search">
157
<h3>Quick search</h3>
158
<form class="search" action="../search.html" method="get">
159
<input type="text" name="q" />
160
<input type="submit" value="Go" />
161
<input type="hidden" name="check_keywords" value="yes" />
162
<input type="hidden" name="area" value="default" />
164
<p class="searchtip" style="font-size: 90%">
165
Enter search terms or a module, class or function name.
168
<script type="text/javascript">$('#searchbox').show(0);</script>
171
<div class="clearer"></div>
173
<div class="related" role="navigation" aria-label="related navigation">
176
<li class="right" style="margin-right: 10px">
177
<a href="../genindex.html" title="General Index"
180
<a href="../py-modindex.html" title="Python Module Index"
183
<a href="pyclbr.html" title="32.9. pyclbr — Python class browser support"
186
<a href="tokenize.html" title="32.7. tokenize — Tokenizer for Python source"
188
<li><img src="../_static/py.png" alt=""
189
style="vertical-align: middle; margin-top: -1px"/></li>
190
<li><a href="https://www.python.org/">Python</a> »</li>
192
<span class="version_switcher_placeholder">3.5.1</span>
193
<a href="../index.html">Documentation </a> »
196
<li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> »</li>
197
<li class="nav-item nav-item-2"><a href="language.html" >32. Python Language Services</a> »</li>
201
© <a href="../copyright.html">Copyright</a> 1990-2016, Python Software Foundation.
203
The Python Software Foundation is a non-profit corporation.
204
<a href="https://www.python.org/psf/donations/">Please donate.</a>
206
Last updated on Jan 22, 2016.
207
<a href="../bugs.html">Found a bug</a>?
209
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.3.3.
b'\\ No newline at end of file'