forked from gak/pycallgraph
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7772a5b
commit 361dcd9
Showing
11 changed files
with
1,270 additions
and
0 deletions.
There are no files selected for viewing
110 changes: 110 additions & 0 deletions
110
branch/docs/examples-fix-attempt/_modules/pycallgraph/globbing_filter.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
<!DOCTYPE html> | ||
|
||
<html lang="en" data-content_root="../../"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>pycallgraph.globbing_filter — Python Call Graph 2.1.1 documentation</title> | ||
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" /> | ||
<link rel="stylesheet" type="text/css" href="../../_static/classic.css?v=514cf933" /> | ||
<link rel="stylesheet" href="../../_static/style.css" type="text/css" /> | ||
|
||
<script src="../../_static/documentation_options.js?v=841abef3"></script> | ||
<script src="../../_static/doctools.js?v=888ff710"></script> | ||
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script> | ||
|
||
<link rel="index" title="Index" href="../../genindex.html" /> | ||
<link rel="search" title="Search" href="../../search.html" /> | ||
</head><body> | ||
<div class="related" role="navigation" aria-label="related navigation"> | ||
<h3>Navigation</h3> | ||
<ul> | ||
<li class="right" style="margin-right: 10px"> | ||
<a href="../../genindex.html" title="General Index" | ||
accesskey="I">index</a></li> | ||
<li class="nav-item nav-item-0"><a href="../../index.html">Python Call Graph 2.1.1 documentation</a> »</li> | ||
<li class="nav-item nav-item-1"><a href="../index.html" accesskey="U">Module code</a> »</li> | ||
<li class="nav-item nav-item-this"><a href="">pycallgraph.globbing_filter</a></li> | ||
</ul> | ||
</div> | ||
|
||
<div class="document"> | ||
<div class="documentwrapper"> | ||
<div class="bodywrapper"> | ||
<div class="body" role="main"> | ||
|
||
<h1>Source code for pycallgraph.globbing_filter</h1><div class="highlight"><pre> | ||
<span></span><span class="kn">from</span> <span class="nn">fnmatch</span> <span class="kn">import</span> <span class="n">fnmatch</span> | ||
|
||
|
||
<div class="viewcode-block" id="GlobbingFilter"> | ||
<a class="viewcode-back" href="../../api/globbing_filter.html#pycallgraph.globbing_filter.GlobbingFilter">[docs]</a> | ||
<span class="k">class</span> <span class="nc">GlobbingFilter</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span> | ||
<span class="w"> </span><span class="sd">'''Filter module names using a set of globs.</span> | ||
|
||
<span class="sd"> Objects are matched against the exclude list first, then the include list.</span> | ||
<span class="sd"> Anything that passes through without matching either, is excluded.</span> | ||
<span class="sd"> '''</span> | ||
|
||
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">include</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">exclude</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> | ||
<span class="k">if</span> <span class="n">include</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">and</span> <span class="n">exclude</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> | ||
<span class="n">include</span> <span class="o">=</span> <span class="p">[</span><span class="s1">'*'</span><span class="p">]</span> | ||
<span class="n">exclude</span> <span class="o">=</span> <span class="p">[]</span> | ||
<span class="k">elif</span> <span class="n">include</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> | ||
<span class="n">include</span> <span class="o">=</span> <span class="p">[</span><span class="s1">'*'</span><span class="p">]</span> | ||
<span class="k">elif</span> <span class="n">exclude</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> | ||
<span class="n">exclude</span> <span class="o">=</span> <span class="p">[]</span> | ||
|
||
<span class="bp">self</span><span class="o">.</span><span class="n">include</span> <span class="o">=</span> <span class="n">include</span> | ||
<span class="bp">self</span><span class="o">.</span><span class="n">exclude</span> <span class="o">=</span> <span class="n">exclude</span> | ||
|
||
<span class="k">def</span> <span class="fm">__call__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">full_name</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> | ||
<span class="k">for</span> <span class="n">pattern</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">exclude</span><span class="p">:</span> | ||
<span class="k">if</span> <span class="n">fnmatch</span><span class="p">(</span><span class="n">full_name</span><span class="p">,</span> <span class="n">pattern</span><span class="p">):</span> | ||
<span class="k">return</span> <span class="kc">False</span> | ||
|
||
<span class="k">for</span> <span class="n">pattern</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">include</span><span class="p">:</span> | ||
<span class="k">if</span> <span class="n">fnmatch</span><span class="p">(</span><span class="n">full_name</span><span class="p">,</span> <span class="n">pattern</span><span class="p">):</span> | ||
<span class="k">return</span> <span class="kc">True</span> | ||
|
||
<span class="k">return</span> <span class="kc">False</span></div> | ||
|
||
</pre></div> | ||
|
||
<div class="clearer"></div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation"> | ||
<div class="sphinxsidebarwrapper"> | ||
<div id="searchbox" style="display: none" role="search"> | ||
<h3 id="searchlabel">Quick search</h3> | ||
<div class="searchformwrapper"> | ||
<form class="search" action="../../search.html" method="get"> | ||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/> | ||
<input type="submit" value="Go" /> | ||
</form> | ||
</div> | ||
</div> | ||
<script>document.getElementById('searchbox').style.display = "block"</script> | ||
</div> | ||
</div> | ||
<div class="clearer"></div> | ||
</div> | ||
<div class="related" role="navigation" aria-label="related navigation"> | ||
<h3>Navigation</h3> | ||
<ul> | ||
<li class="right" style="margin-right: 10px"> | ||
<a href="../../genindex.html" title="General Index" | ||
>index</a></li> | ||
<li class="nav-item nav-item-0"><a href="../../index.html">Python Call Graph 2.1.1 documentation</a> »</li> | ||
<li class="nav-item nav-item-1"><a href="../index.html" >Module code</a> »</li> | ||
<li class="nav-item nav-item-this"><a href="">pycallgraph.globbing_filter</a></li> | ||
</ul> | ||
</div> | ||
<div class="footer" role="contentinfo"> | ||
© Copyright 2007-2024 Gerald Kaszuba, et al.. | ||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6. | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.