Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-updates > by-pkgid > b9a6a1b9f2781444d2917afd8e4421ab > files > 899

ipython-doc-2.3.0-2.2.mga5.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Module: utils.module_paths &mdash; IPython 2.3.0 documentation</title>
    
    <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../',
        VERSION:     '2.3.0',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../_static/doctools.js"></script>
    <link rel="top" title="IPython 2.3.0 documentation" href="../../index.html" />
    <link rel="up" title="The IPython API" href="../index.html" />
    <link rel="next" title="Module: utils.openpy" href="IPython.utils.openpy.html" />
    <link rel="prev" title="Module: utils.localinterfaces" href="IPython.utils.localinterfaces.html" /> 
  </head>
  <body>

<div style="background-color: white; text-align: left; padding: 10px 10px 15px 15px">
<a href="http://ipython.org/"><img src="../../_static/logo.png" border="0" alt="IPython Documentation"/></a>
</div>

    <div class="related">
      <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="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="IPython.utils.openpy.html" title="Module: utils.openpy"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="IPython.utils.localinterfaces.html" title="Module: utils.localinterfaces"
             accesskey="P">previous</a> |</li>
        <li><a href="http://ipython.org">home</a>|&nbsp;</li>
        <li><a href="../../search.html">search</a>|&nbsp;</li>
       <li><a href="../../index.html">documentation </a> &raquo;</li>

          <li><a href="../index.html" accesskey="U">The IPython API</a> &raquo;</li> 
      </ul>
    </div>

      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Module: <tt class="docutils literal"><span class="pre">utils.module_paths</span></tt></a><ul>
<li><a class="reference internal" href="#functions">3 Functions</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="IPython.utils.localinterfaces.html"
                        title="previous chapter">Module: <tt class="docutils literal"><span class="pre">utils.localinterfaces</span></tt></a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="IPython.utils.openpy.html"
                        title="next chapter">Module: <tt class="docutils literal"><span class="pre">utils.openpy</span></tt></a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../../_sources/api/generated/IPython.utils.module_paths.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-IPython.utils.module_paths">
<span id="module-utils-module-paths"></span><h1>Module: <tt class="xref py py-mod docutils literal"><span class="pre">utils.module_paths</span></tt><a class="headerlink" href="#module-IPython.utils.module_paths" title="Permalink to this headline">¶</a></h1>
<p>Utility functions for finding modules</p>
<p>Utility functions for finding modules on sys.path.</p>
<p><cite>find_mod</cite> finds named module on sys.path.</p>
<p><cite>get_init</cite> helper function that finds __init__ file in a directory.</p>
<p><cite>find_module</cite> variant of imp.find_module in std_lib that only returns
path to module and not an open file object as well.</p>
<div class="section" id="functions">
<h2>3 Functions<a class="headerlink" href="#functions" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="IPython.utils.module_paths.find_module">
<tt class="descclassname">IPython.utils.module_paths.</tt><tt class="descname">find_module</tt><big>(</big><em>name</em>, <em>path=None</em><big>)</big><a class="headerlink" href="#IPython.utils.module_paths.find_module" title="Permalink to this definition">¶</a></dt>
<dd><p>imp.find_module variant that only return path of module.</p>
<p>The <cite>imp.find_module</cite> returns a filehandle that we are not interested in.
Also we ignore any bytecode files that <cite>imp.find_module</cite> finds.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>name</strong> : str</p>
<blockquote>
<div><p>name of module to locate</p>
</div></blockquote>
<p><strong>path</strong> : list of str</p>
<blockquote>
<div><p>list of paths to search for <cite>name</cite>. If path=None then search sys.path</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>filename</strong> : str</p>
<blockquote class="last">
<div><p>Return full path of module or None if module is missing or does not have
.py or .pyw extension</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="IPython.utils.module_paths.get_init">
<tt class="descclassname">IPython.utils.module_paths.</tt><tt class="descname">get_init</tt><big>(</big><em>dirname</em><big>)</big><a class="headerlink" href="#IPython.utils.module_paths.get_init" title="Permalink to this definition">¶</a></dt>
<dd><p>Get __init__ file path for module directory</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>dirname</strong> : str</p>
<blockquote>
<div><p>Find the __init__ file in directory <cite>dirname</cite></p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>init_path</strong> : str</p>
<blockquote class="last">
<div><p>Path to __init__ file</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="IPython.utils.module_paths.find_mod">
<tt class="descclassname">IPython.utils.module_paths.</tt><tt class="descname">find_mod</tt><big>(</big><em>module_name</em><big>)</big><a class="headerlink" href="#IPython.utils.module_paths.find_mod" title="Permalink to this definition">¶</a></dt>
<dd><p>Find module <cite>module_name</cite> on sys.path</p>
<p>Return the path to module <cite>module_name</cite>. If <cite>module_name</cite> refers to
a module directory then return path to __init__ file. Return full 
path of module or None if module is missing or does not have .py or .pyw
extension. We are not interested in running bytecode.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>module_name</strong> : str</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>modulepath</strong> : str</p>
<blockquote class="last">
<div><p>Path to module <cite>module_name</cite>.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="IPython.utils.openpy.html" title="Module: utils.openpy"
             >next</a> |</li>
        <li class="right" >
          <a href="IPython.utils.localinterfaces.html" title="Module: utils.localinterfaces"
             >previous</a> |</li>
        <li><a href="http://ipython.org">home</a>|&nbsp;</li>
        <li><a href="../../search.html">search</a>|&nbsp;</li>
       <li><a href="../../index.html">documentation </a> &raquo;</li>

          <li><a href="../index.html" >The IPython API</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright The IPython Development Team.
      Last updated on Jul 14, 2015.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
    </div>
  </body>
</html>