~dkuhlman/python-training-materials/Materials

« back to all changes in this revision

Viewing changes to python-3.5.1-docs-html/library/tabnanny.html

  • Committer: Dave Kuhlman
  • Date: 2017-04-15 16:24:56 UTC
  • Revision ID: dkuhlman@davekuhlman.org-20170415162456-iav9vozzg4iwqwv3
Updated docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
 
 
4
 
 
5
 
<html xmlns="http://www.w3.org/1999/xhtml">
6
 
  <head>
7
 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
 
    
9
 
    <title>32.8. tabnanny — Detection of ambiguous indentation &mdash; Python 3.5.1 documentation</title>
10
 
    
11
 
    <link rel="stylesheet" href="../_static/pydoctheme.css" type="text/css" />
12
 
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
13
 
    
14
 
    <script type="text/javascript">
15
 
      var DOCUMENTATION_OPTIONS = {
16
 
        URL_ROOT:    '../',
17
 
        VERSION:     '3.5.1',
18
 
        COLLAPSE_INDEX: false,
19
 
        FILE_SUFFIX: '.html',
20
 
        HAS_SOURCE:  true
21
 
      };
22
 
    </script>
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>
39
 
    
40
 
 
41
 
 
42
 
  </head>
43
 
  <body role="document">  
44
 
    <div class="related" role="navigation" aria-label="related navigation">
45
 
      <h3>Navigation</h3>
46
 
      <ul>
47
 
        <li class="right" style="margin-right: 10px">
48
 
          <a href="../genindex.html" title="General Index"
49
 
             accesskey="I">index</a></li>
50
 
        <li class="right" >
51
 
          <a href="../py-modindex.html" title="Python Module Index"
52
 
             >modules</a> |</li>
53
 
        <li class="right" >
54
 
          <a href="pyclbr.html" title="32.9. pyclbr — Python class browser support"
55
 
             accesskey="N">next</a> |</li>
56
 
        <li class="right" >
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> &raquo;</li>
62
 
        <li>
63
 
          <span class="version_switcher_placeholder">3.5.1</span>
64
 
          <a href="../index.html">Documentation </a> &raquo;
65
 
        </li>
66
 
 
67
 
          <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &raquo;</li>
68
 
          <li class="nav-item nav-item-2"><a href="language.html" accesskey="U">32. Python Language Services</a> &raquo;</li> 
69
 
      </ul>
70
 
    </div>    
71
 
 
72
 
    <div class="document">
73
 
      <div class="documentwrapper">
74
 
        <div class="bodywrapper">
75
 
          <div class="body" role="main">
76
 
            
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> &#8212; 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>
83
 
described below.</p>
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>
88
 
</div>
89
 
<dl class="function">
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>
97
 
</dd></dl>
98
 
 
99
 
<dl class="data">
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>
104
 
</dd></dl>
105
 
 
106
 
<dl class="data">
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
111
 
as a script.</p>
112
 
</dd></dl>
113
 
 
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>
119
 
</dd></dl>
120
 
 
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>
126
 
</dd></dl>
127
 
 
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>
133
 
</dl>
134
 
</div>
135
 
</div>
136
 
 
137
 
 
138
 
          </div>
139
 
        </div>
140
 
      </div>
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> &#8212; Tokenizer for Python source</a></p>
146
 
  <h4>Next topic</h4>
147
 
  <p class="topless"><a href="pyclbr.html"
148
 
                        title="next chapter">32.9. <code class="docutils literal"><span class="pre">pyclbr</span></code> &#8212; Python class browser support</a></p>
149
 
<h3>This Page</h3>
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>
154
 
</ul>
155
 
 
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" />
163
 
    </form>
164
 
    <p class="searchtip" style="font-size: 90%">
165
 
    Enter search terms or a module, class or function name.
166
 
    </p>
167
 
</div>
168
 
<script type="text/javascript">$('#searchbox').show(0);</script>
169
 
        </div>
170
 
      </div>
171
 
      <div class="clearer"></div>
172
 
    </div>  
173
 
    <div class="related" role="navigation" aria-label="related navigation">
174
 
      <h3>Navigation</h3>
175
 
      <ul>
176
 
        <li class="right" style="margin-right: 10px">
177
 
          <a href="../genindex.html" title="General Index"
178
 
             >index</a></li>
179
 
        <li class="right" >
180
 
          <a href="../py-modindex.html" title="Python Module Index"
181
 
             >modules</a> |</li>
182
 
        <li class="right" >
183
 
          <a href="pyclbr.html" title="32.9. pyclbr — Python class browser support"
184
 
             >next</a> |</li>
185
 
        <li class="right" >
186
 
          <a href="tokenize.html" title="32.7. tokenize — Tokenizer for Python source"
187
 
             >previous</a> |</li>
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> &raquo;</li>
191
 
        <li>
192
 
          <span class="version_switcher_placeholder">3.5.1</span>
193
 
          <a href="../index.html">Documentation </a> &raquo;
194
 
        </li>
195
 
 
196
 
          <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &raquo;</li>
197
 
          <li class="nav-item nav-item-2"><a href="language.html" >32. Python Language Services</a> &raquo;</li> 
198
 
      </ul>
199
 
    </div>  
200
 
    <div class="footer">
201
 
    &copy; <a href="../copyright.html">Copyright</a> 1990-2016, Python Software Foundation.
202
 
    <br />
203
 
    The Python Software Foundation is a non-profit corporation.
204
 
    <a href="https://www.python.org/psf/donations/">Please donate.</a>
205
 
    <br />
206
 
    Last updated on Jan 22, 2016.
207
 
    <a href="../bugs.html">Found a bug</a>?
208
 
    <br />
209
 
    Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.3.3.
210
 
    </div>
211
 
 
212
 
  </body>
213
 
</html>
 
 
b'\\ No newline at end of file'