summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill McGugan <willmcgugan@gmail.com>2017-01-08 15:46:28 +0000
committerWill McGugan <willmcgugan@gmail.com>2017-01-08 15:46:28 +0000
commitd2bd0ed2760978ba45123d689cb9474b846d77db (patch)
tree4848748773fc984cb9a13bc14a42e4e118212595
parentc94b20c877f1f2ab190d7b1eae3ecc53b3a6d295 (diff)
downloadpyfilesystem-git-d2bd0ed2760978ba45123d689cb9474b846d77db.tar.gz
some doc fixes
-rw-r--r--docs/base.rst6
-rw-r--r--docs/concepts.rst14
-rw-r--r--docs/contrib.rst6
-rw-r--r--docs/expose.rst14
-rw-r--r--docs/filesystems.rst22
-rw-r--r--docs/getting_started.rst6
-rw-r--r--docs/implementersguide.rst36
-rw-r--r--docs/interface.rst4
-rw-r--r--docs/utilities.rst8
-rw-r--r--fs/appdirfs.py2
-rw-r--r--fs/base.py8
-rw-r--r--fs/httpfs.py2
-rw-r--r--fs/opener.py2
-rw-r--r--fs/rpcfs.py2
14 files changed, 66 insertions, 66 deletions
diff --git a/docs/base.rst b/docs/base.rst
index 835c61d..08e4543 100644
--- a/docs/base.rst
+++ b/docs/base.rst
@@ -10,11 +10,11 @@ All Filesystem objects inherit from this class.
.. autoclass:: fs.base.FS
:members:
-
+
fs.base.SubFS
-------------
-A SubFS is an FS implementation that represents a directory on another Filesystem. When you use the :meth:`fs.base.FS.opendir` method it will return a SubFS instance. You should not need to instantiate a SubFS directly.
+A SubFS is an FS implementation that represents a directory on another Filesystem. When you use the :meth:`~fs.base.FS.opendir` method it will return a SubFS instance. You should not need to instantiate a SubFS directly.
For example::
@@ -28,7 +28,7 @@ fs.base.NullFile
A NullFile is a file-like object with no functionality. It is used in situations where a file-like object is required but the caller doesn't have any data to read or write.
-The :meth:`fs.base.FS.safeopen` method returns an NullFile instance, which can reduce error-handling code.
+The :meth:`~fs.base.FS.safeopen` method returns an NullFile instance, which can reduce error-handling code.
For example, the following code may be written to append some text to a log file::
diff --git a/docs/concepts.rst b/docs/concepts.rst
index dceaacd..52b80a4 100644
--- a/docs/concepts.rst
+++ b/docs/concepts.rst
@@ -1,7 +1,7 @@
Concepts
========
-Working with PyFilesystem is generally easier than working with lower level interfaces, as long as you are aware these simple concepts.
+Working with PyFilesystem is generally easier than working with lower level interfaces, as long as you are aware these simple concepts.
Sandboxing
----------
@@ -31,7 +31,7 @@ Fortunately we can isolate a single sub-directory with then :meth:`~fs.base.FS.o
bar_fs = foo_fs.opendir('bar')
-This creates a completely new FS object that represents everything in the `foo/bar` directory. The root directory of `bar_fs` has been re-position, so that from `bar_fs`'s point of view, the readme.txt and photo.jpg files are in the root::
+This creates a completely new FS object that represents everything in the `foo/bar` directory. The root directory of `bar_fs` has been re-positioned, so that from `bar_fs`'s point of view, the readme.txt and photo.jpg files are in the root::
--bar
|--readme.txt
@@ -45,7 +45,7 @@ PyFilesystem will catch any attempts to read outside of the root directory. For
Paths
-----
-Paths used within an FS object use the same common format, regardless of the underlying file system it represents (or the platform it resides on).
+Paths used within an FS object use the same common format, regardless of the underlying file system it represents (or the platform it resides on).
When working with paths in FS objects, keep in mind the following:
@@ -54,11 +54,11 @@ When working with paths in FS objects, keep in mind the following:
* Paths not beginning with a forward slash are relative
* A single dot means 'current directory'
* A double dot means 'previous directory'
-
+
Note that paths used by the FS interface will use this format, but the constructor or additional methods may not.
Notably the :mod:`~fs.osfs.OSFS` constructor which requires an OS path -- the format of which is platform-dependent.
-There are many helpful functions for working with paths in the :mod:`fs.path` module.
+There are many helpful functions for working with paths in the :mod:`~fs.path` module.
System Paths
++++++++++++
@@ -78,7 +78,7 @@ If you call :meth:`~fs.base.FS.getsyspath` on such FS objects you will either ge
Errors
------
-PyFilesystem converts all exceptions to a common type, so that you need only write your exception handling code once. For example, if you try to open a file that doesn't exist, PyFilesystem will throw a :class:`fs.errors.ResourceNotFoundError` regardless of whether the filesystem is local, on a ftp server or in a zip file::
+PyFilesystem converts all exceptions to a common type, so that you need only write your exception handling code once. For example, if you try to open a file that doesn't exist, PyFilesystem will throw a :class:`~fs.errors.ResourceNotFoundError` regardless of whether the filesystem is local, on a ftp server or in a zip file::
>>> from fs.osfs import OSFS
>>> root_fs = OSFS('/')
@@ -91,4 +91,4 @@ PyFilesystem converts all exceptions to a common type, so that you need only wri
return open(self.getsyspath(path), mode, kwargs.get("buffering", -1))
fs.errors.ResourceNotFoundError: Resource not found: doesnotexist.txt
-All PyFilesystem exceptions are derived from :class:`fs.errors.FSError`, so you may use that if you want to catch all possible filesystem related exceptions.
+All PyFilesystem exceptions are derived from :class:`~fs.errors.FSError`, so you may use that if you want to catch all possible filesystem related exceptions.
diff --git a/docs/contrib.rst b/docs/contrib.rst
index 34182ee..54aadcc 100644
--- a/docs/contrib.rst
+++ b/docs/contrib.rst
@@ -7,16 +7,16 @@ module namespace.
DAV (WebDAV Protocol)
----------------------------
-An interface to WebDAV file servers. See :mod:`fs.contrib.davfs`
+An interface to WebDAV file servers. See :mod:`~fs.contrib.davfs`
Tahoe LAFS
----------
-An interface to Tahoe Least-Authority File System. See :mod:`fs.contrib.tahoelafs`
+An interface to Tahoe Least-Authority File System. See :mod:`~fs.contrib.tahoelafs`
BIG (BIG Archive File Format)
-----------------------------
-A read-only interface to the BIG archive file format used in some EA games titles (e.g. Command & Conquer 4). See :mod:`fs.contrib.bigfs`
+A read-only interface to the BIG archive file format used in some EA games titles (e.g. Command & Conquer 4). See :mod:`~fs.contrib.bigfs`
diff --git a/docs/expose.rst b/docs/expose.rst
index 31e3d86..d8da688 100644
--- a/docs/expose.rst
+++ b/docs/expose.rst
@@ -1,29 +1,29 @@
Exposing FS objects
===================
-The ``fs.expose`` module offers a number of ways of making an FS implementation available over an Internet connection, or to other processes on the system.
+The ``fs.expose`` module offers a number of ways of making an FS implementation available over an Internet connection, or to other processes on the system.
FUSE
----
-Makes an FS object available to other applications on the system. See :mod:`fs.expose.fuse`.
+Makes an FS object available to other applications on the system. See :mod:`~fs.expose.fuse`.
Dokan
-----
-Makes an FS object available to other applications on the system. See :mod:`fs.expose.dokan`.
+Makes an FS object available to other applications on the system. See :mod:`~fs.expose.dokan`.
Secure FTP
----------
-Makes an FS object available via Secure FTP. See :mod:`fs.expose.sftp`.
+Makes an FS object available via Secure FTP. See :mod:`~fs.expose.sftp`.
XMLRPC
------
-Makes an FS object available over XMLRPC. See :mod:`fs.expose.xmlrpc`
+Makes an FS object available over XMLRPC. See :mod:`~fs.expose.xmlrpc`
Import Hook
-----------
-Allows importing python modules from the files in an FS object. See :mod:`fs.expose.importhook`
+Allows importing python modules from the files in an FS object. See :mod:`~fs.expose.importhook`
Django Storage
--------------
-Connects FS objects to Django. See :mod:`fs.expose.django_storage`
+Connects FS objects to Django. See :mod:`~fs.expose.django_storage`
diff --git a/docs/filesystems.rst b/docs/filesystems.rst
index 01effcb..fc79abe 100644
--- a/docs/filesystems.rst
+++ b/docs/filesystems.rst
@@ -6,55 +6,55 @@ This page lists the builtin filesystems.
FTP (File Transfer Protocol)
----------------------------
-An interface to FTP servers. See :class:`fs.ftpfs.FTPFS`
+An interface to FTP servers. See :class:`~fs.ftpfs.FTPFS`
Memory
------
-A filesystem that exists entirely in memory. See :mod:`fs.memoryfs`
+A filesystem that exists entirely in memory. See :mod:`~fs.memoryfs`
Mount
-----
-A filesystem that can map directories in to other filesystems (like a symlink). See :mod:`fs.mountfs`
+A filesystem that can map directories in to other filesystems (like a symlink). See :mod:`~fs.mountfs`
Multi
-----
-A filesystem that overlays other filesystems. See :mod:`fs.multifs`
+A filesystem that overlays other filesystems. See :mod:`~fs.multifs`
OS
--
-An interface to the OS Filesystem. See :mod:`fs.osfs`
+An interface to the OS Filesystem. See :mod:`~fs.osfs`
RPCFS (Remote Procedure Call)
-----------------------------
-An interface to a file-system served over XML RPC, See :mod:`fs.rpcfs` and :mod:`fs.expose.xmlrpc`
+An interface to a file-system served over XML RPC, See :mod:`~fs.rpcfs` and :mod:`~fs.expose.xmlrpc`
SFTP (Secure FTP)
-----------------------
-A secure FTP filesystem. See :mod:`fs.sftpfs`
+A secure FTP filesystem. See :mod:`~fs.sftpfs`
S3
--
-A filesystem to access an Amazon S3 service. See :mod:`fs.s3fs`
+A filesystem to access an Amazon S3 service. See :mod:`~fs.s3fs`
Temporary
---------
-Creates a temporary filesystem in an OS provided location. See :mod:`fs.tempfs`
+Creates a temporary filesystem in an OS provided location. See :mod:`~fs.tempfs`
Wrap
----
-A collection of wrappers that add new behavior / features to existing FS instances. See :mod:`fs.wrapfs`
+A collection of wrappers that add new behavior / features to existing FS instances. See :mod:`~fs.wrapfs`
Zip
---
-An interface to zip files. See :mod:`fs.zipfs`
+An interface to zip files. See :mod:`~fs.zipfs`
diff --git a/docs/getting_started.rst b/docs/getting_started.rst
index e05a13e..6001428 100644
--- a/docs/getting_started.rst
+++ b/docs/getting_started.rst
@@ -41,9 +41,9 @@ Prerequisites
PyFilesystem requires at least **Python 2.6**. There are a few other dependencies if you want to use some of the more advanced filesystem interfaces, but for basic use all that is needed is the Python standard library.
- * Boto (required for :mod:`fs.s3fs`) https://github.com/boto/boto
- * Paramiko (required for :mod:`fs.sftpfs`) https://github.com/paramiko/paramiko
- * wxPython (required for :mod:`fs.browsewin`) http://www.wxpython.org/
+ * Boto (required for :mod:`~fs.s3fs`) https://github.com/boto/boto
+ * Paramiko (required for :mod:`~fs.sftpfs`) https://github.com/paramiko/paramiko
+ * wxPython (required for :mod:`~fs.browsewin`) http://www.wxpython.org/
Quick Examples
diff --git a/docs/implementersguide.rst b/docs/implementersguide.rst
index debdf71..4fa569f 100644
--- a/docs/implementersguide.rst
+++ b/docs/implementersguide.rst
@@ -1,43 +1,43 @@
.. _implementers:
-A Guide For Filesystem Implementers
+A Guide For Filesystem Implementers
===================================
PyFilesystem objects are designed to be as generic as possible and still expose the full filesystem functionality.
-With a little care, you can write a wrapper for your filesystem that allows it to work interchangeably with any of the built-in FS classes and tools.
+With a little care, you can write a wrapper for your filesystem that allows it to work interchangeably with any of the built-in FS classes and tools.
-To create a working PyFilesystem interface, derive a class from :py:class:`fs.base.FS` and implement the 9 :ref:`essential-methods`.
+To create a working PyFilesystem interface, derive a class from :py:class:`~fs.base.FS` and implement the 9 :ref:`essential-methods`.
The base class uses these essential methods as a starting point for providing a lot of extra functionality,
but in some cases the default implementation may not be the most efficient.
For example, most filesystems have an atomic way of moving a file from one location to another without having to copy data,
whereas the default implementation of :meth:`~fs.base.FS.move` method must copy all the bytes in the source file to the destination file.
-Any of the :ref:`non-essential-methods` may be overridden, but efficient custom versions of the following methods will have the greatest impact on performance:
+Any of the :ref:`non-essential-methods` may be overridden, but efficient custom versions of the following methods will have the greatest impact on performance:
* :meth:`~fs.base.FS.copy` copy a file
* :meth:`~fs.base.FS.copydir` copy a directory
* :meth:`~fs.base.FS.exists` check if a file / directory exists
- * :meth:`~fs.base.FS.getsyspath` get a system path for a given resource, if it exists
+ * :meth:`~fs.base.FS.getsyspath` get a system path for a given resource, if it exists
* :meth:`~fs.base.FS.move` move a file
* :meth:`~fs.base.FS.movedir` move a directory
For network based filesystems (i.e. where the physical data is pulled over a network),
there are a few methods which can reduce the number of round trips to the server,
if an efficient implementation is provided:
-
+
* :meth:`~fs.base.FS.listdirinfo` returns the directory contents and info dictionary in one call
- * :meth:`~fs.base.FS.ilistdir` a generator version of :meth:`~fs.base.FS.listdir`
+ * :meth:`~fs.base.FS.ilistdir` a generator version of :meth:`~fs.base.FS.listdir`
* :meth:`~fs.base.FS.ilistdirinfo` a generator version of :meth:`~fs.base.FS.listdirinfo`
The generator methods (beginning with ``i``) are intended for use with filesystems that contain a lot of files,
where reading the directory in one go may be expensive.
Other methods in the :doc:`interface` are unlikely to require a non-default implementation,
-but there is nothing preventing you from implementing them -- just be careful to use the same signature and replicate expected functionality.
+but there is nothing preventing you from implementing them -- just be careful to use the same signature and replicate expected functionality.
Filesystem Errors
-----------------
-With the exception of the constructor, FS methods should throw :class:`fs.errors.FSError` exceptions in preference to any implementation-specific exception classes,
+With the exception of the constructor, FS methods should throw :class:`~fs.errors.FSError` exceptions in preference to any implementation-specific exception classes,
so that generic exception handling can be written.
The constructor *may* throw a non-FSError exception, if no appropriate FSError exists.
The rationale for this is that creating an FS interface may require specific knowledge,
@@ -53,7 +53,7 @@ and passes the original exception as an argument.::
someapi.open(path, mode)
except someapi.UnableToOpen, e:
raise errors.ResourceNotFoundError(path=path, details=e)
-
+
Any code written to catch the generic error, can also retrieve the original exception if it contains additional information.
Thread Safety
@@ -75,7 +75,7 @@ Implementations are also free to reserve a dotted namespace notation for themsel
If you do this, please avoid generic terms as they may conflict with existing or future implementations.
For example ``"bobs_ftpfs.author"``, rather than ``"ftpfs.author"``.
-If your meta values are static, i.e. they never change, then create a dictionary class attribute called ``_meta`` in your implementation that contains all the meta keys and values.
+If your meta values are static, i.e. they never change, then create a dictionary class attribute called ``_meta`` in your implementation that contains all the meta keys and values.
The default ``getmeta`` implementation will pull the meta values from this dictionary.
.. _essential-methods:
@@ -94,19 +94,19 @@ The following methods are required for a minimal Filesystem interface:
* :meth:`~fs.base.FS.removedir` Remove an existing directory
* :meth:`~fs.base.FS.rename` Atomically rename a file or directory
* :meth:`~fs.base.FS.getinfo` Return information about the path e.g. size, mtime
-
+
.. _non-essential-methods:
Non - Essential Methods
-----------------------
-The following methods have default implementations in :py:class:`fs.base.FS` and aren't required for a functional FS interface. They may be overridden if an alternative implementation can be supplied:
+The following methods have default implementations in :py:class:`~fs.base.FS` and aren't required for a functional FS interface. They may be overridden if an alternative implementation can be supplied:
* :meth:`~fs.base.FS.copy` Copy a file to a new location
* :meth:`~fs.base.FS.copydir` Recursively copy a directory to a new location
* :meth:`~fs.base.FS.desc` Return a short descriptive text regarding a path
- * :meth:`~fs.base.FS.exists` Check whether a path exists as file or directory
+ * :meth:`~fs.base.FS.exists` Check whether a path exists as file or directory
* :meth:`~fs.base.FS.listdirinfo` Get a directory listing along with the info dict for each entry
* :meth:`~fs.base.FS.ilistdir` Generator version of the listdir method
* :meth:`~fs.base.FS.ilistdirinfo` Generator version of the listdirinfo method
@@ -114,9 +114,9 @@ The following methods have default implementations in :py:class:`fs.base.FS` and
* :meth:`~fs.base.FS.getsyspath` Get a file's name in the local filesystem, if possible
* :meth:`~fs.base.FS.getmeta` Get the value of a filesystem meta value, if it exists
* :meth:`~fs.base.FS.getmmap` Gets an mmap object for the given resource, if supported
- * :meth:`~fs.base.FS.hassyspath` Check if a path maps to a system path (recognized by the OS)
- * :meth:`~fs.base.FS.haspathurl` Check if a path maps to an external URL
+ * :meth:`~fs.base.FS.hassyspath` Check if a path maps to a system path (recognized by the OS)
+ * :meth:`~fs.base.FS.haspathurl` Check if a path maps to an external URL
* :meth:`~fs.base.FS.hasmeta` Check if a filesystem meta value exists
- * :meth:`~fs.base.FS.move` Move a file to a new location
- * :meth:`~fs.base.FS.movedir` Recursively move a directory to a new location
+ * :meth:`~fs.base.FS.move` Move a file to a new location
+ * :meth:`~fs.base.FS.movedir` Recursively move a directory to a new location
* :meth:`~fs.base.FS.settimes` Sets the accessed and modified times of a path
diff --git a/docs/interface.rst b/docs/interface.rst
index 5ebc4fa..b648506 100644
--- a/docs/interface.rst
+++ b/docs/interface.rst
@@ -4,7 +4,7 @@ Filesystem Interface
====================
The following methods are available in all PyFilesystem implementation:
-
+
* :meth:`~fs.base.FS.close` Close the filesystem and free any resources
* :meth:`~fs.base.FS.copy` Copy a file to a new location
* :meth:`~fs.base.FS.copydir` Recursively copy a directory to a new location
@@ -47,6 +47,6 @@ The following methods are available in all PyFilesystem implementation:
* :meth:`~fs.base.FS.walkdirs` Returns an iterable of paths to sub-directories
* :meth:`~fs.base.FS.walkfiles` Returns an iterable of file paths in a directory, and its sub-directories
-See :py:class:`fs.base.FS` for the method signature and full details.
+See :py:class:`~fs.base.FS` for the method signature and full details.
If you intend to implement an FS object, see :ref:`implementers`.
diff --git a/docs/utilities.rst b/docs/utilities.rst
index 3097729..9079c32 100644
--- a/docs/utilities.rst
+++ b/docs/utilities.rst
@@ -7,17 +7,17 @@ new FS implementations easier.
fs.path
-------
-Contains many utility functions for manipulating filesystem paths. See :mod:`fs.path`.
+Contains many utility functions for manipulating filesystem paths. See :mod:`~fs.path`.
fs.errors
---------
-Contains all the standard error classes used by PyFilesystem, along with some useful error-handling decorators. See :mod:`fs.errors`.
+Contains all the standard error classes used by PyFilesystem, along with some useful error-handling decorators. See :mod:`~fs.errors`.
fs.filelike
-----------
-Takes care of a lot of the groundwork for implementing and manipulating objects that support Python's standard "file-like" interface. See :mod:`fs.filelike`.
+Takes care of a lot of the groundwork for implementing and manipulating objects that support Python's standard "file-like" interface. See :mod:`~fs.filelike`.
fs.remote
---------
-Contains useful functions and classes for implementing remote filesystems. See :mod:`fs.remote`.
+Contains useful functions and classes for implementing remote filesystems. See :mod:`~fs.remote`.
diff --git a/fs/appdirfs.py b/fs/appdirfs.py
index 86d8082..071b48c 100644
--- a/fs/appdirfs.py
+++ b/fs/appdirfs.py
@@ -5,7 +5,7 @@ fs.appdirfs
A collection of filesystems that map to application specific locations.
These classes abstract away the different requirements for user data across platforms,
-which vary in their conventions. They are all subclasses of :class:`fs.osfs.OSFS`,
+which vary in their conventions. They are all subclasses of :class:`~fs.osfs.OSFS`,
all that differs from `OSFS` is the constructor which detects the appropriate
location given the name of the application, author name and other parameters.
diff --git a/fs/base.py b/fs/base.py
index 8785bb7..3d25ec5 100644
--- a/fs/base.py
+++ b/fs/base.py
@@ -68,7 +68,7 @@ class DummyLock(object):
def silence_fserrors(f, *args, **kwargs):
- """Perform a function call and return ``None`` if an :class:`fs.errors.FSError` is thrown
+ """Perform a function call and return ``None`` if an :class:`~fs.errors.FSError` is thrown
:param f: Function to call
:param args: Parameters to f
@@ -89,7 +89,7 @@ class NoDefaultMeta(object):
class NullFile(object):
"""A NullFile is a file object that has no functionality.
- Null files are returned by the :meth:`fs.base.FS.safeopen` method in FS objects when the
+ Null files are returned by the :meth:`~fs.base.FS.safeopen` method in FS objects when the
file doesn't exist. This can simplify code by negating the need to check
if a file exists, or handling exceptions.
@@ -589,9 +589,9 @@ class FS(object):
files_only=False):
"""Generator yielding the files and directories under a given path.
- This method behaves identically to :py:meth:`fs.base.FS.listdir` but returns an generator
+ This method behaves identically to :py:meth:`~fs.base.FS.listdir` but returns an generator
instead of a list. Depending on the filesystem this may be more
- efficient than calling :py:meth:`fs.base.FS.listdir` and iterating over the resulting list.
+ efficient than calling :py:meth:`~fs.base.FS.listdir` and iterating over the resulting list.
"""
return iter(self.listdir(path,
diff --git a/fs/httpfs.py b/fs/httpfs.py
index 65514f4..9587394 100644
--- a/fs/httpfs.py
+++ b/fs/httpfs.py
@@ -21,7 +21,7 @@ class HTTPFS(FS):
typical filesystem functionality. This class exists to allow the :doc:`opener` system
to read files over HTTP.
- If you do need filesystem like functionality over HTTP, see :mod:`fs.contrib.davfs`.
+ If you do need filesystem like functionality over HTTP, see :mod:`~fs.contrib.davfs`.
"""
diff --git a/fs/opener.py b/fs/opener.py
index 6079226..e77b296 100644
--- a/fs/opener.py
+++ b/fs/opener.py
@@ -171,7 +171,7 @@ class OpenerRegistry(object):
"""Retrieve an opener for the given protocol
:param name: name of the opener to open
- :raises NoOpenerError: if no opener has been registered of that name
+ :raises `NoOpenerError`: if no opener has been registered of that name
"""
if name not in self.registry:
diff --git a/fs/rpcfs.py b/fs/rpcfs.py
index 00ba86a..15b6d3d 100644
--- a/fs/rpcfs.py
+++ b/fs/rpcfs.py
@@ -4,7 +4,7 @@ fs.rpcfs
This module provides the class 'RPCFS' to access a remote FS object over
XML-RPC. You probably want to use this in conjunction with the 'RPCFSServer'
-class from the :mod:`fs.expose.xmlrpc` module.
+class from the :mod:`~fs.expose.xmlrpc` module.
"""