Skip to content

Commit

Permalink
deploy: c5dbf40
Browse files Browse the repository at this point in the history
  • Loading branch information
Lewiscowles1986 committed Mar 31, 2024
1 parent 7772a5b commit 361dcd9
Show file tree
Hide file tree
Showing 11 changed files with 1,270 additions and 0 deletions.
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 &#8212; 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> &#187;</li>
<li class="nav-item nav-item-1"><a href="../index.html" accesskey="U">Module code</a> &#187;</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">&#39;&#39;&#39;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"> &#39;&#39;&#39;</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">&#39;*&#39;</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">&#39;*&#39;</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> &#187;</li>
<li class="nav-item nav-item-1"><a href="../index.html" >Module code</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">pycallgraph.globbing_filter</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2007-2024 Gerald Kaszuba, et al..
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.
</div>
</body>
</html>
Loading

0 comments on commit 361dcd9

Please sign in to comment.