366 lines
27 KiB
HTML
366 lines
27 KiB
HTML
<!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>3. py.path — py lib v1.0.0b1 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: '1.0.0b1',
|
|
COLLAPSE_MODINDEX: false,
|
|
FILE_SUFFIX: '.html',
|
|
HAS_SOURCE: true
|
|
};
|
|
</script>
|
|
<script type="text/javascript" src="_static/jquery.js"></script>
|
|
<script type="text/javascript" src="_static/doctools.js"></script>
|
|
<link rel="top" title="py lib v1.0.0b1 documentation" href="index.html" />
|
|
<link rel="next" title="4. py.code" href="code.html" />
|
|
<link rel="prev" title="2. py.execnet" href="execnet.html" />
|
|
</head>
|
|
<body>
|
|
<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="code.html" title="4. py.code"
|
|
accesskey="N">next</a> |</li>
|
|
<li class="right" >
|
|
<a href="execnet.html" title="2. py.execnet"
|
|
accesskey="P">previous</a> |</li>
|
|
<li><a href="index.html">py lib v1.0.0b1 documentation</a> »</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="document">
|
|
<div class="documentwrapper">
|
|
<div class="bodywrapper">
|
|
<div class="body">
|
|
|
|
<div class="section" id="py-path">
|
|
<h1>3. py.path<a class="headerlink" href="#py-path" title="Permalink to this headline">¶</a></h1>
|
|
<p>The ‘py’ lib provides a uniform high-level api to deal with filesystems
|
|
and filesystem-like interfaces: <tt class="docutils literal"><span class="pre">py.path</span></tt>. It aims to offer a central
|
|
object to fs-like object trees (reading from and writing to files, adding
|
|
files/directories, examining the types and structure, etc.), and out-of-the-box
|
|
provides a number of implementations of this API.</p>
|
|
<div class="section" id="path-implementations-provided-by-py-path">
|
|
<h2>3.1. Path implementations provided by <tt class="docutils literal"><span class="pre">py.path</span></tt><a class="headerlink" href="#path-implementations-provided-by-py-path" title="Permalink to this headline">¶</a></h2>
|
|
<div class="section" id="py-path-local">
|
|
<h3>3.1.1. <tt class="docutils literal"><span class="pre">py.path.local</span></tt><a class="headerlink" href="#py-path-local" title="Permalink to this headline">¶</a></h3>
|
|
<p>The first and most obvious of the implementations is a wrapper around a local
|
|
filesystem. It’s just a bit nicer in usage than the regular Python APIs, and
|
|
of course all the functionality is bundled together rather than spread over a
|
|
number of modules.</p>
|
|
<p>Example usage, here we use the <tt class="docutils literal"><span class="pre">py.test.ensuretemp()</span></tt> function to create
|
|
a <tt class="docutils literal"><span class="pre">py.path.local</span></tt> object for us (which wraps a directory):</p>
|
|
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="kn">import</span> <span class="nn">py</span>
|
|
<span class="gp">>>> </span><span class="n">temppath</span> <span class="o">=</span> <span class="n">py</span><span class="o">.</span><span class="n">test</span><span class="o">.</span><span class="n">ensuretemp</span><span class="p">(</span><span class="s">'py.path_documentation'</span><span class="p">)</span>
|
|
<span class="gp">>>> </span><span class="n">foopath</span> <span class="o">=</span> <span class="n">temppath</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="s">'foo'</span><span class="p">)</span> <span class="c"># get child 'foo' (lazily)</span>
|
|
<span class="gp">>>> </span><span class="n">foopath</span><span class="o">.</span><span class="n">check</span><span class="p">()</span> <span class="c"># check if child 'foo' exists</span>
|
|
<span class="go">False</span>
|
|
<span class="gp">>>> </span><span class="n">foopath</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">'bar'</span><span class="p">)</span> <span class="c"># write some data to it</span>
|
|
<span class="gp">>>> </span><span class="n">foopath</span><span class="o">.</span><span class="n">check</span><span class="p">()</span>
|
|
<span class="go">True</span>
|
|
<span class="gp">>>> </span><span class="n">foopath</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
|
|
<span class="go">'bar'</span>
|
|
<span class="gp">>>> </span><span class="n">foofile</span> <span class="o">=</span> <span class="n">foopath</span><span class="o">.</span><span class="n">open</span><span class="p">()</span> <span class="c"># return a 'real' file object</span>
|
|
<span class="gp">>>> </span><span class="n">foofile</span><span class="o">.</span><span class="n">read</span><span class="p">(</span><span class="mf">1</span><span class="p">)</span>
|
|
<span class="go">'b'</span>
|
|
</pre></div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="py-path-svnurl-and-py-path-svnwc">
|
|
<h3>3.1.2. <tt class="docutils literal"><span class="pre">py.path.svnurl</span></tt> and <tt class="docutils literal"><span class="pre">py.path.svnwc</span></tt><a class="headerlink" href="#py-path-svnurl-and-py-path-svnwc" title="Permalink to this headline">¶</a></h3>
|
|
<p>Two other <tt class="docutils literal"><span class="pre">py.path</span></tt> implementations that the py lib provides wrap the
|
|
popular <a class="reference external" href="http://subversion.tigris.org/">Subversion</a> revision control system: the first (called ‘svnurl’)
|
|
by interfacing with a remote server, the second by wrapping a local checkout.
|
|
Both allow you to access relatively advanced features such as metadata and
|
|
versioning, and both in a way more user-friendly manner than existing other
|
|
solutions.</p>
|
|
<p>Some example usage of <tt class="docutils literal"><span class="pre">py.path.svnurl</span></tt>:</p>
|
|
<div class="highlight-python"><pre>.. >>> import py
|
|
.. >>> if not py.test.config.option.urlcheck: raise ValueError('skipchunk')
|
|
>>> url = py.path.svnurl('http://codespeak.net/svn/py')
|
|
>>> info = url.info()
|
|
>>> info.kind
|
|
'dir'
|
|
>>> firstentry = url.log()[-1]
|
|
>>> import time
|
|
>>> time.strftime('%Y-%m-%d', time.gmtime(firstentry.date))
|
|
'2004-10-02'</pre>
|
|
</div>
|
|
<p>Example usage of <tt class="docutils literal"><span class="pre">py.path.svnwc</span></tt>:</p>
|
|
<div class="highlight-python"><pre>.. >>> if not py.test.config.option.urlcheck: raise ValueError('skipchunk')
|
|
>>> temp = py.test.ensuretemp('py.path_documentation')
|
|
>>> wc = py.path.svnwc(temp.join('svnwc'))
|
|
>>> wc.checkout('http://codespeak.net/svn/py/dist/py/path/local')
|
|
>>> wc.join('local.py').check()
|
|
True</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="common-vs-specific-api">
|
|
<h2>3.2. Common vs. specific API<a class="headerlink" href="#common-vs-specific-api" title="Permalink to this headline">¶</a></h2>
|
|
<p>All Path objects support a common set of operations, suitable
|
|
for many use cases and allowing to transparently switch the
|
|
path object within an application (e.g. from “local” to “svnwc”).
|
|
The common set includes functions such as <cite>path.read()</cite> to read all data
|
|
from a file, <cite>path.write()</cite> to write data, <cite>path.listdir()</cite> to get a list
|
|
of directory entries, <cite>path.check()</cite> to check if a node exists
|
|
and is of a particular type, <cite>path.join()</cite> to get
|
|
to a (grand)child, <cite>path.visit()</cite> to recursively walk through a node’s
|
|
children, etc. Only things that are not common on ‘normal’ filesystems (yet),
|
|
such as handling metadata (e.g. the Subversion “properties”) require
|
|
using specific APIs.</p>
|
|
<div class="section" id="examples">
|
|
<h3>3.2.1. Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h3>
|
|
<p>A quick ‘cookbook’ of small examples that will be useful ‘in real life’,
|
|
which also presents parts of the ‘common’ API, and shows some non-common
|
|
methods:</p>
|
|
<div class="section" id="searching-txt-files">
|
|
<h4>3.2.1.1. Searching <cite>.txt</cite> files<a class="headerlink" href="#searching-txt-files" title="Permalink to this headline">¶</a></h4>
|
|
<p>Search for a particular string inside all files with a .txt extension in a
|
|
specific directory.</p>
|
|
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">dirpath</span> <span class="o">=</span> <span class="n">temppath</span><span class="o">.</span><span class="n">ensure</span><span class="p">(</span><span class="s">'testdir'</span><span class="p">,</span> <span class="nb">dir</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
|
|
<span class="gp">>>> </span><span class="n">dirpath</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="s">'textfile1.txt'</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">'foo bar baz'</span><span class="p">)</span>
|
|
<span class="gp">>>> </span><span class="n">dirpath</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="s">'textfile2.txt'</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">'frob bar spam eggs'</span><span class="p">)</span>
|
|
<span class="gp">>>> </span><span class="n">subdir</span> <span class="o">=</span> <span class="n">dirpath</span><span class="o">.</span><span class="n">ensure</span><span class="p">(</span><span class="s">'subdir'</span><span class="p">,</span> <span class="nb">dir</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
|
|
<span class="gp">>>> </span><span class="n">subdir</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="s">'textfile1.txt'</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">'foo baz'</span><span class="p">)</span>
|
|
<span class="gp">>>> </span><span class="n">subdir</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="s">'textfile2.txt'</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">'spam eggs spam foo bar spam'</span><span class="p">)</span>
|
|
<span class="gp">>>> </span><span class="n">results</span> <span class="o">=</span> <span class="p">[]</span>
|
|
<span class="gp">>>> </span><span class="k">for</span> <span class="n">fpath</span> <span class="ow">in</span> <span class="n">dirpath</span><span class="o">.</span><span class="n">visit</span><span class="p">(</span><span class="s">'*.txt'</span><span class="p">):</span>
|
|
<span class="gp">... </span> <span class="k">if</span> <span class="s">'bar'</span> <span class="ow">in</span> <span class="n">fpath</span><span class="o">.</span><span class="n">read</span><span class="p">():</span>
|
|
<span class="gp">... </span> <span class="n">results</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">fpath</span><span class="o">.</span><span class="n">basename</span><span class="p">)</span>
|
|
<span class="gp">>>> </span><span class="n">results</span><span class="o">.</span><span class="n">sort</span><span class="p">()</span>
|
|
<span class="gp">>>> </span><span class="n">results</span>
|
|
<span class="go">['textfile1.txt', 'textfile2.txt', 'textfile2.txt']</span>
|
|
</pre></div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="working-with-paths">
|
|
<h4>3.2.1.2. Working with Paths<a class="headerlink" href="#working-with-paths" title="Permalink to this headline">¶</a></h4>
|
|
<p>This example shows the <tt class="docutils literal"><span class="pre">py.path</span></tt> features to deal with
|
|
filesystem paths Note that the filesystem is never touched,
|
|
all operations are performed on a string level (so the paths
|
|
don’t have to exist, either):</p>
|
|
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">p1</span> <span class="o">=</span> <span class="n">py</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">local</span><span class="p">(</span><span class="s">'/foo/bar'</span><span class="p">)</span>
|
|
<span class="gp">>>> </span><span class="n">p2</span> <span class="o">=</span> <span class="n">p1</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="s">'baz/qux'</span><span class="p">)</span>
|
|
<span class="gp">>>> </span><span class="n">p2</span> <span class="o">==</span> <span class="n">py</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">local</span><span class="p">(</span><span class="s">'/foo/bar/baz/qux'</span><span class="p">)</span>
|
|
<span class="go">True</span>
|
|
<span class="gp">>>> </span><span class="n">sep</span> <span class="o">=</span> <span class="n">py</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">local</span><span class="o">.</span><span class="n">sep</span>
|
|
<span class="gp">>>> </span><span class="n">p2</span><span class="o">.</span><span class="n">relto</span><span class="p">(</span><span class="n">p1</span><span class="p">)</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">sep</span><span class="p">,</span> <span class="s">'/'</span><span class="p">)</span> <span class="c"># os-specific path sep in the string</span>
|
|
<span class="go">'baz/qux'</span>
|
|
<span class="gp">>>> </span><span class="n">p2</span><span class="o">.</span><span class="n">bestrelpath</span><span class="p">(</span><span class="n">p1</span><span class="p">)</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">sep</span><span class="p">,</span> <span class="s">'/'</span><span class="p">)</span>
|
|
<span class="go">'../..'</span>
|
|
<span class="gp">>>> </span><span class="n">p2</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">p2</span><span class="o">.</span><span class="n">bestrelpath</span><span class="p">(</span><span class="n">p1</span><span class="p">))</span> <span class="o">==</span> <span class="n">p1</span>
|
|
<span class="go">True</span>
|
|
<span class="gp">>>> </span><span class="n">p3</span> <span class="o">=</span> <span class="n">p1</span> <span class="o">/</span> <span class="s">'baz/qux'</span> <span class="c"># the / operator allows joining, too</span>
|
|
<span class="gp">>>> </span><span class="n">p2</span> <span class="o">==</span> <span class="n">p3</span>
|
|
<span class="go">True</span>
|
|
<span class="gp">>>> </span><span class="n">p4</span> <span class="o">=</span> <span class="n">p1</span> <span class="o">+</span> <span class="s">".py"</span>
|
|
<span class="gp">>>> </span><span class="n">p4</span><span class="o">.</span><span class="n">basename</span> <span class="o">==</span> <span class="s">"bar.py"</span>
|
|
<span class="go">True</span>
|
|
<span class="gp">>>> </span><span class="n">p4</span><span class="o">.</span><span class="n">ext</span> <span class="o">==</span> <span class="s">".py"</span>
|
|
<span class="go">True</span>
|
|
<span class="gp">>>> </span><span class="n">p4</span><span class="o">.</span><span class="n">purebasename</span> <span class="o">==</span> <span class="s">"bar"</span>
|
|
<span class="go">True</span>
|
|
</pre></div>
|
|
</div>
|
|
<p>This should be possible on every implementation of <tt class="docutils literal"><span class="pre">py.path</span></tt>, so
|
|
regardless of whether the implementation wraps a UNIX filesystem, a Windows
|
|
one, or a database or object tree, these functions should be available (each
|
|
with their own notion of path seperators and dealing with conversions, etc.).</p>
|
|
</div>
|
|
<div class="section" id="checking-path-types">
|
|
<h4>3.2.1.3. Checking path types<a class="headerlink" href="#checking-path-types" title="Permalink to this headline">¶</a></h4>
|
|
<p>Now we will show a bit about the powerful ‘check()’ method on paths, which
|
|
allows you to check whether a file exists, what type it is, etc.:</p>
|
|
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">file1</span> <span class="o">=</span> <span class="n">temppath</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="s">'file1'</span><span class="p">)</span>
|
|
<span class="gp">>>> </span><span class="n">file1</span><span class="o">.</span><span class="n">check</span><span class="p">()</span> <span class="c"># does it exist?</span>
|
|
<span class="go">False</span>
|
|
<span class="gp">>>> </span><span class="n">file1</span> <span class="o">=</span> <span class="n">file1</span><span class="o">.</span><span class="n">ensure</span><span class="p">(</span><span class="nb">file</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span> <span class="c"># 'touch' the file</span>
|
|
<span class="gp">>>> </span><span class="n">file1</span><span class="o">.</span><span class="n">check</span><span class="p">()</span>
|
|
<span class="go">True</span>
|
|
<span class="gp">>>> </span><span class="n">file1</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="nb">dir</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span> <span class="c"># is it a dir?</span>
|
|
<span class="go">False</span>
|
|
<span class="gp">>>> </span><span class="n">file1</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="nb">file</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span> <span class="c"># or a file?</span>
|
|
<span class="go">True</span>
|
|
<span class="gp">>>> </span><span class="n">file1</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="n">ext</span><span class="o">=</span><span class="s">'.txt'</span><span class="p">)</span> <span class="c"># check the extension</span>
|
|
<span class="go">False</span>
|
|
<span class="gp">>>> </span><span class="n">textfile</span> <span class="o">=</span> <span class="n">temppath</span><span class="o">.</span><span class="n">ensure</span><span class="p">(</span><span class="s">'text.txt'</span><span class="p">,</span> <span class="nb">file</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
|
|
<span class="gp">>>> </span><span class="n">textfile</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="n">ext</span><span class="o">=</span><span class="s">'.txt'</span><span class="p">)</span>
|
|
<span class="go">True</span>
|
|
<span class="gp">>>> </span><span class="n">file1</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="n">basename</span><span class="o">=</span><span class="s">'file1'</span><span class="p">)</span> <span class="c"># we can use all the path's properties here</span>
|
|
<span class="go">True</span>
|
|
</pre></div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="setting-svn-properties">
|
|
<h4>3.2.1.4. Setting svn-properties<a class="headerlink" href="#setting-svn-properties" title="Permalink to this headline">¶</a></h4>
|
|
<p>As an example of ‘uncommon’ methods, we’ll show how to read and write
|
|
properties in an <tt class="docutils literal"><span class="pre">py.path.svnwc</span></tt> instance:</p>
|
|
<div class="highlight-python"><pre>.. >>> if not py.test.config.option.urlcheck: raise ValueError('skipchunk')
|
|
>>> wc.propget('foo')
|
|
''
|
|
>>> wc.propset('foo', 'bar')
|
|
>>> wc.propget('foo')
|
|
'bar'
|
|
>>> len(wc.status().prop_modified) # our own props
|
|
1
|
|
>>> msg = wc.revert() # roll back our changes
|
|
>>> len(wc.status().prop_modified)
|
|
0</pre>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="svn-authentication">
|
|
<h4>3.2.1.5. SVN authentication<a class="headerlink" href="#svn-authentication" title="Permalink to this headline">¶</a></h4>
|
|
<p>Some uncommon functionality can also be provided as extensions, such as SVN
|
|
authentication:</p>
|
|
<div class="highlight-python"><pre>.. >>> if not py.test.config.option.urlcheck: raise ValueError('skipchunk')
|
|
>>> auth = py.path.SvnAuth('anonymous', 'user', cache_auth=False,
|
|
... interactive=False)
|
|
>>> wc.auth = auth
|
|
>>> wc.update() # this should work
|
|
>>> path = wc.ensure('thisshouldnotexist.txt')
|
|
>>> try:
|
|
... path.commit('testing')
|
|
... except py.process.cmdexec.Error, e:
|
|
... pass
|
|
>>> 'authorization failed' in str(e)
|
|
True</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="known-problems-limitations">
|
|
<h2>3.3. Known problems / limitations<a class="headerlink" href="#known-problems-limitations" title="Permalink to this headline">¶</a></h2>
|
|
<ul class="simple">
|
|
<li>The SVN path objects require the “svn” command line,
|
|
there is currently no support for python bindings.
|
|
Parsing the svn output can lead to problems, particularly
|
|
regarding if you have a non-english “locales” setting.</li>
|
|
<li>While the path objects basically work on windows,
|
|
there is no attention yet on making unicode paths
|
|
work or deal with the famous “8.3” filename issues.</li>
|
|
</ul>
|
|
</div>
|
|
<div class="section" id="future-plans">
|
|
<h2>3.4. Future plans<a class="headerlink" href="#future-plans" title="Permalink to this headline">¶</a></h2>
|
|
<p>The Subversion path implementations are based
|
|
on the <cite>svn</cite> command line, not on the bindings.
|
|
It makes sense now to directly use the bindings.</p>
|
|
<p>Moreover, it would be good, also considering
|
|
<a class="reference external" href="execnet.html">py.execnet</a> distribution of programs, to
|
|
be able to manipulate Windows Paths on Linux
|
|
and vice versa. So we’d like to consider
|
|
refactoring the path implementations
|
|
to provide this choice (and getting rid
|
|
of platform-dependencies as much as possible).</p>
|
|
<p>There is some experimental small approach
|
|
(<tt class="docutils literal"><span class="pre">py/path/gateway/</span></tt>) aiming at having
|
|
a convenient Remote Path implementation
|
|
and some considerations about future
|
|
works in the according <tt class="docutils literal"><span class="pre">py/path/gateway/TODO.txt</span></tt></p>
|
|
<p>There are various hacks out there to have
|
|
Memory-Filesystems and even path objects
|
|
being directly mountable under Linux (via <cite>fuse</cite>).
|
|
However, the Path object implementations
|
|
do not internally have a clean abstraction
|
|
of going to the filesystem - so with some
|
|
refactoring it should become easier to
|
|
have very custom Path objects, still offering
|
|
the quite full interface without requiring
|
|
to know about all details of the full path
|
|
implementation.</p>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="sphinxsidebar">
|
|
<div class="sphinxsidebarwrapper">
|
|
<h3><a href="index.html">Table Of Contents</a></h3>
|
|
<ul>
|
|
<li><a class="reference external" href="">3. py.path</a><ul>
|
|
<li><a class="reference external" href="#path-implementations-provided-by-py-path">3.1. Path implementations provided by <tt class="docutils literal"><span class="pre">py.path</span></tt></a><ul>
|
|
<li><a class="reference external" href="#py-path-local">3.1.1. <tt class="docutils literal"><span class="pre">py.path.local</span></tt></a></li>
|
|
<li><a class="reference external" href="#py-path-svnurl-and-py-path-svnwc">3.1.2. <tt class="docutils literal"><span class="pre">py.path.svnurl</span></tt> and <tt class="docutils literal"><span class="pre">py.path.svnwc</span></tt></a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a class="reference external" href="#common-vs-specific-api">3.2. Common vs. specific API</a><ul>
|
|
<li><a class="reference external" href="#examples">3.2.1. Examples</a><ul>
|
|
<li><a class="reference external" href="#searching-txt-files">3.2.1.1. Searching <cite>.txt</cite> files</a></li>
|
|
<li><a class="reference external" href="#working-with-paths">3.2.1.2. Working with Paths</a></li>
|
|
<li><a class="reference external" href="#checking-path-types">3.2.1.3. Checking path types</a></li>
|
|
<li><a class="reference external" href="#setting-svn-properties">3.2.1.4. Setting svn-properties</a></li>
|
|
<li><a class="reference external" href="#svn-authentication">3.2.1.5. SVN authentication</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li><a class="reference external" href="#known-problems-limitations">3.3. Known problems / limitations</a></li>
|
|
<li><a class="reference external" href="#future-plans">3.4. Future plans</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
|
|
<h4>Previous topic</h4>
|
|
<p class="topless"><a href="execnet.html"
|
|
title="previous chapter">2. py.execnet</a></p>
|
|
<h4>Next topic</h4>
|
|
<p class="topless"><a href="code.html"
|
|
title="next chapter">4. py.code</a></p>
|
|
<h3>This Page</h3>
|
|
<ul class="this-page-menu">
|
|
<li><a href="_sources/path.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" size="18" />
|
|
<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="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="code.html" title="4. py.code"
|
|
>next</a> |</li>
|
|
<li class="right" >
|
|
<a href="execnet.html" title="2. py.execnet"
|
|
>previous</a> |</li>
|
|
<li><a href="index.html">py lib v1.0.0b1 documentation</a> »</li>
|
|
</ul>
|
|
</div>
|
|
<div class="footer">
|
|
© Copyright 2009, Holger Krekel.
|
|
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.7.
|
|
</div>
|
|
</body>
|
|
</html> |