PageRenderTime 40ms CodeModel.GetById 11ms RepoModel.GetById 1ms app.codeStats 0ms

/docs/1.1.8/generated/cf.dirname.html

https://bitbucket.org/cfpython/cfpython.bitbucket.org
HTML | 204 lines | 160 code | 14 blank | 30 comment | 0 complexity | bd005d2ee6488feafde85882582f7603 MD5 | raw file
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>cf.dirname &mdash; Documentation</title>
  7. <link rel="stylesheet" href="../_static/classic.css" type="text/css" />
  8. <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
  9. <script type="text/javascript">
  10. var DOCUMENTATION_OPTIONS = {
  11. URL_ROOT: '../',
  12. VERSION: '1.1.8',
  13. COLLAPSE_INDEX: false,
  14. FILE_SUFFIX: '.html',
  15. HAS_SOURCE: true
  16. };
  17. </script>
  18. <script type="text/javascript" src="../_static/jquery.js"></script>
  19. <script type="text/javascript" src="../_static/underscore.js"></script>
  20. <script type="text/javascript" src="../_static/doctools.js"></script>
  21. <script type="text/javascript" src="../_static/copybutton.js"></script>
  22. <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
  23. <link rel="top" title="Documentation" href="../index.html" />
  24. <link rel="up" title="Functions of the cf module" href="../function.html" />
  25. <link rel="next" title="cf.flat" href="cf.flat.html" />
  26. <link rel="prev" title="cf.abspath" href="cf.abspath.html" />
  27. </head>
  28. <body role="document">
  29. <div class="related" role="navigation" aria-label="related navigation">
  30. <h3>Navigation</h3>
  31. <ul>
  32. <li class="right" style="margin-right: 10px">
  33. <a href="../genindex.html" title="General Index"
  34. accesskey="I">index</a></li>
  35. <li class="right" >
  36. <a href="cf.flat.html" title="cf.flat"
  37. accesskey="N">next</a> |</li>
  38. <li class="right" >
  39. <a href="cf.abspath.html" title="cf.abspath"
  40. accesskey="P">previous</a> |</li>
  41. <li><a target="_blank" href="http://cfpython.bitbucket.org">cf-python 1.1.8</a> &raquo;</li>
  42. <!--
  43. <li><a target="_blank" href="http://cfpython.bitbucket.org">cf-python</a> &raquo;</li>
  44. <li><select onchange="location = this.options[this.selectedIndex].value;">
  45. <option value="../../1.0/index.html">1.0
  46. <option value="../../0.9.9/index.html">0.9.9
  47. <option value="../../0.9.8.3/index.html">0.9.8.3
  48. <option value="../../archive.html">Archive
  49. </select>
  50. </li>
  51. -->
  52. <li class="nav-item nav-item-0"><a href="../index.html">Documentation</a> &raquo;</li>
  53. <li class="nav-item nav-item-1"><a href="../reference.html" >Reference manual</a> &raquo;</li>
  54. <li class="nav-item nav-item-2"><a href="../function.html" accesskey="U">Functions of the <code class="docutils literal"><span class="pre">cf</span></code> module</a> &raquo;</li>
  55. </ul>
  56. </div>
  57. <div class="document">
  58. <div class="documentwrapper">
  59. <div class="bodywrapper">
  60. <div class="body" role="main">
  61. <div class="section" id="cf-dirname">
  62. <h1>cf.dirname<a class="headerlink" href="#cf-dirname" title="Permalink to this headline">Âś</a></h1>
  63. <dl class="function">
  64. <dt id="cf.dirname">
  65. <code class="descclassname">cf.</code><code class="descname">dirname</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="reference external" href="https://bitbucket.org/cfpython/cf-python/src/v1.1.8/cf/functions.py#functions.py-1745"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cf.dirname" title="Permalink to this definition">Âś</a></dt>
  66. <dd><p>Return the directory name of a file.</p>
  67. <p>If a string containing URL is provided then everything up to, but not
  68. including, the last slash (/) is returned.</p>
  69. <table class="docutils field-list" frame="void" rules="none">
  70. <col class="field-name" />
  71. <col class="field-body" />
  72. <tbody valign="top">
  73. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><dl class="first docutils">
  74. <dt>filename <span class="classifier-delimiter">:</span> <span class="classifier">str</span></dt>
  75. <dd><p class="first last">The name of the file.</p>
  76. </dd>
  77. </dl>
  78. </td>
  79. </tr>
  80. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
  81. <dt>out <span class="classifier-delimiter">:</span> <span class="classifier">str</span></dt>
  82. <dd><p class="first last">The directory name.</p>
  83. </dd>
  84. </dl>
  85. </td>
  86. </tr>
  87. </tbody>
  88. </table>
  89. <div class="admonition seealso">
  90. <p class="first admonition-title">See also</p>
  91. <p class="last"><a class="reference internal" href="cf.abspath.html#cf.abspath" title="cf.abspath"><code class="xref py py-obj docutils literal"><span class="pre">cf.abspath</span></code></a>, <a class="reference internal" href="cf.pathjoin.html#cf.pathjoin" title="cf.pathjoin"><code class="xref py py-obj docutils literal"><span class="pre">cf.pathjoin</span></code></a>, <a class="reference internal" href="cf.relpath.html#cf.relpath" title="cf.relpath"><code class="xref py py-obj docutils literal"><span class="pre">cf.relpath</span></code></a></p>
  92. </div>
  93. <table class="docutils field-list" frame="void" rules="none">
  94. <col class="field-name" />
  95. <col class="field-body" />
  96. <tbody valign="top">
  97. <tr class="field-odd field"><th class="field-name">Examples:</th><td class="field-body"></td>
  98. </tr>
  99. </tbody>
  100. </table>
  101. <div class="highlight-python"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">cf</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="s1">&#39;/data/archive/file.nc&#39;</span><span class="p">)</span>
  102. <span class="go">&#39;/data/archive&#39;</span>
  103. <span class="gp">&gt;&gt;&gt; </span><span class="n">cf</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="s1">&#39;..//file.nc&#39;</span><span class="p">)</span>
  104. <span class="go">&#39;..&#39;</span>
  105. <span class="gp">&gt;&gt;&gt; </span><span class="n">cf</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="s1">&#39;http://data/archive/file.nc&#39;</span><span class="p">)</span>
  106. <span class="go">&#39;http://data/archive&#39;</span>
  107. </pre></div>
  108. </div>
  109. </dd></dl>
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  115. <div class="sphinxsidebarwrapper">
  116. <h4>Previous topic</h4>
  117. <p class="topless"><a href="cf.abspath.html"
  118. title="previous chapter">cf.abspath</a></p>
  119. <h4>Next topic</h4>
  120. <p class="topless"><a href="cf.flat.html"
  121. title="next chapter">cf.flat</a></p>
  122. <div role="note" aria-label="source link">
  123. <h3>This Page</h3>
  124. <ul class="this-page-menu">
  125. <li><a href="../_sources/generated/cf.dirname.txt"
  126. rel="nofollow">Show Source</a></li>
  127. </ul>
  128. </div>
  129. <div id="searchbox" style="display: none" role="search">
  130. <h3>Quick search</h3>
  131. <form class="search" action="../search.html" method="get">
  132. <input type="text" name="q" />
  133. <input type="submit" value="Go" />
  134. <input type="hidden" name="check_keywords" value="yes" />
  135. <input type="hidden" name="area" value="default" />
  136. </form>
  137. <p class="searchtip" style="font-size: 90%">
  138. Enter search terms or a module, class or function name.
  139. </p>
  140. </div>
  141. <script type="text/javascript">$('#searchbox').show(0);</script>
  142. </div>
  143. </div>
  144. <div class="clearer"></div>
  145. </div>
  146. <div class="related" role="navigation" aria-label="related navigation">
  147. <h3>Navigation</h3>
  148. <ul>
  149. <li class="right" style="margin-right: 10px">
  150. <a href="../genindex.html" title="General Index"
  151. >index</a></li>
  152. <li class="right" >
  153. <a href="cf.flat.html" title="cf.flat"
  154. >next</a> |</li>
  155. <li class="right" >
  156. <a href="cf.abspath.html" title="cf.abspath"
  157. >previous</a> |</li>
  158. <li><a target="_blank" href="http://cfpython.bitbucket.org">cf-python 1.1.8</a> &raquo;</li>
  159. <!--
  160. <li><a target="_blank" href="http://cfpython.bitbucket.org">cf-python</a> &raquo;</li>
  161. <li><select onchange="location = this.options[this.selectedIndex].value;">
  162. <option value="../../1.0/index.html">1.0
  163. <option value="../../0.9.9/index.html">0.9.9
  164. <option value="../../0.9.8.3/index.html">0.9.8.3
  165. <option value="../../archive.html">Archive
  166. </select>
  167. </li>
  168. -->
  169. <li class="nav-item nav-item-0"><a href="../index.html">Documentation</a> &raquo;</li>
  170. <li class="nav-item nav-item-1"><a href="../reference.html" >Reference manual</a> &raquo;</li>
  171. <li class="nav-item nav-item-2"><a href="../function.html" >Functions of the <code class="docutils literal"><span class="pre">cf</span></code> module</a> &raquo;</li>
  172. </ul>
  173. </div>
  174. <div class="footer" role="contentinfo">
  175. &copy; Copyright 2016, David Hassell.
  176. Last updated on May 18, 2016.
  177. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.5.
  178. </div>
  179. </body>
  180. </html>