Skip to content

Commit d2bd0ed

Browse files
committed
some doc fixes
1 parent c94b20c commit d2bd0ed

14 files changed

Lines changed: 66 additions & 66 deletions

docs/base.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ All Filesystem objects inherit from this class.
1010

1111
.. autoclass:: fs.base.FS
1212
:members:
13-
13+
1414
fs.base.SubFS
1515
-------------
1616

17-
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.
17+
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.
1818

1919
For example::
2020

@@ -28,7 +28,7 @@ fs.base.NullFile
2828

2929
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.
3030

31-
The :meth:`fs.base.FS.safeopen` method returns an NullFile instance, which can reduce error-handling code.
31+
The :meth:`~fs.base.FS.safeopen` method returns an NullFile instance, which can reduce error-handling code.
3232

3333
For example, the following code may be written to append some text to a log file::
3434

docs/concepts.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Concepts
22
========
33

4-
Working with PyFilesystem is generally easier than working with lower level interfaces, as long as you are aware these simple concepts.
4+
Working with PyFilesystem is generally easier than working with lower level interfaces, as long as you are aware these simple concepts.
55

66
Sandboxing
77
----------
@@ -31,7 +31,7 @@ Fortunately we can isolate a single sub-directory with then :meth:`~fs.base.FS.o
3131

3232
bar_fs = foo_fs.opendir('bar')
3333

34-
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::
34+
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::
3535

3636
--bar
3737
|--readme.txt
@@ -45,7 +45,7 @@ PyFilesystem will catch any attempts to read outside of the root directory. For
4545
Paths
4646
-----
4747

48-
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).
48+
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).
4949

5050
When working with paths in FS objects, keep in mind the following:
5151

@@ -54,11 +54,11 @@ When working with paths in FS objects, keep in mind the following:
5454
* Paths not beginning with a forward slash are relative
5555
* A single dot means 'current directory'
5656
* A double dot means 'previous directory'
57-
57+
5858
Note that paths used by the FS interface will use this format, but the constructor or additional methods may not.
5959
Notably the :mod:`~fs.osfs.OSFS` constructor which requires an OS path -- the format of which is platform-dependent.
6060

61-
There are many helpful functions for working with paths in the :mod:`fs.path` module.
61+
There are many helpful functions for working with paths in the :mod:`~fs.path` module.
6262

6363
System Paths
6464
++++++++++++
@@ -78,7 +78,7 @@ If you call :meth:`~fs.base.FS.getsyspath` on such FS objects you will either ge
7878
Errors
7979
------
8080

81-
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::
81+
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::
8282

8383
>>> from fs.osfs import OSFS
8484
>>> root_fs = OSFS('/')
@@ -91,4 +91,4 @@ PyFilesystem converts all exceptions to a common type, so that you need only wri
9191
return open(self.getsyspath(path), mode, kwargs.get("buffering", -1))
9292
fs.errors.ResourceNotFoundError: Resource not found: doesnotexist.txt
9393

94-
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.
94+
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.

docs/contrib.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ module namespace.
77

88
DAV (WebDAV Protocol)
99
----------------------------
10-
An interface to WebDAV file servers. See :mod:`fs.contrib.davfs`
10+
An interface to WebDAV file servers. See :mod:`~fs.contrib.davfs`
1111

1212

1313
Tahoe LAFS
1414
----------
15-
An interface to Tahoe Least-Authority File System. See :mod:`fs.contrib.tahoelafs`
15+
An interface to Tahoe Least-Authority File System. See :mod:`~fs.contrib.tahoelafs`
1616

1717

1818
BIG (BIG Archive File Format)
1919
-----------------------------
20-
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`
20+
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`
2121

2222

docs/expose.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
Exposing FS objects
22
===================
33

4-
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.
4+
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.
55

66

77
FUSE
88
----
9-
Makes an FS object available to other applications on the system. See :mod:`fs.expose.fuse`.
9+
Makes an FS object available to other applications on the system. See :mod:`~fs.expose.fuse`.
1010

1111
Dokan
1212
-----
13-
Makes an FS object available to other applications on the system. See :mod:`fs.expose.dokan`.
13+
Makes an FS object available to other applications on the system. See :mod:`~fs.expose.dokan`.
1414

1515
Secure FTP
1616
----------
17-
Makes an FS object available via Secure FTP. See :mod:`fs.expose.sftp`.
17+
Makes an FS object available via Secure FTP. See :mod:`~fs.expose.sftp`.
1818

1919
XMLRPC
2020
------
21-
Makes an FS object available over XMLRPC. See :mod:`fs.expose.xmlrpc`
21+
Makes an FS object available over XMLRPC. See :mod:`~fs.expose.xmlrpc`
2222

2323
Import Hook
2424
-----------
25-
Allows importing python modules from the files in an FS object. See :mod:`fs.expose.importhook`
25+
Allows importing python modules from the files in an FS object. See :mod:`~fs.expose.importhook`
2626

2727
Django Storage
2828
--------------
29-
Connects FS objects to Django. See :mod:`fs.expose.django_storage`
29+
Connects FS objects to Django. See :mod:`~fs.expose.django_storage`

docs/filesystems.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,55 +6,55 @@ This page lists the builtin filesystems.
66

77
FTP (File Transfer Protocol)
88
----------------------------
9-
An interface to FTP servers. See :class:`fs.ftpfs.FTPFS`
9+
An interface to FTP servers. See :class:`~fs.ftpfs.FTPFS`
1010

1111
Memory
1212
------
13-
A filesystem that exists entirely in memory. See :mod:`fs.memoryfs`
13+
A filesystem that exists entirely in memory. See :mod:`~fs.memoryfs`
1414

1515

1616
Mount
1717
-----
18-
A filesystem that can map directories in to other filesystems (like a symlink). See :mod:`fs.mountfs`
18+
A filesystem that can map directories in to other filesystems (like a symlink). See :mod:`~fs.mountfs`
1919

2020

2121
Multi
2222
-----
23-
A filesystem that overlays other filesystems. See :mod:`fs.multifs`
23+
A filesystem that overlays other filesystems. See :mod:`~fs.multifs`
2424

2525

2626
OS
2727
--
28-
An interface to the OS Filesystem. See :mod:`fs.osfs`
28+
An interface to the OS Filesystem. See :mod:`~fs.osfs`
2929

3030

3131
RPCFS (Remote Procedure Call)
3232
-----------------------------
33-
An interface to a file-system served over XML RPC, See :mod:`fs.rpcfs` and :mod:`fs.expose.xmlrpc`
33+
An interface to a file-system served over XML RPC, See :mod:`~fs.rpcfs` and :mod:`~fs.expose.xmlrpc`
3434

3535

3636
SFTP (Secure FTP)
3737
-----------------------
38-
A secure FTP filesystem. See :mod:`fs.sftpfs`
38+
A secure FTP filesystem. See :mod:`~fs.sftpfs`
3939

4040

4141
S3
4242
--
43-
A filesystem to access an Amazon S3 service. See :mod:`fs.s3fs`
43+
A filesystem to access an Amazon S3 service. See :mod:`~fs.s3fs`
4444

4545

4646
Temporary
4747
---------
48-
Creates a temporary filesystem in an OS provided location. See :mod:`fs.tempfs`
48+
Creates a temporary filesystem in an OS provided location. See :mod:`~fs.tempfs`
4949

5050

5151
Wrap
5252
----
53-
A collection of wrappers that add new behavior / features to existing FS instances. See :mod:`fs.wrapfs`
53+
A collection of wrappers that add new behavior / features to existing FS instances. See :mod:`~fs.wrapfs`
5454

5555

5656
Zip
5757
---
58-
An interface to zip files. See :mod:`fs.zipfs`
58+
An interface to zip files. See :mod:`~fs.zipfs`
5959

6060

docs/getting_started.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ Prerequisites
4141

4242
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.
4343

44-
* Boto (required for :mod:`fs.s3fs`) https://github.com/boto/boto
45-
* Paramiko (required for :mod:`fs.sftpfs`) https://github.com/paramiko/paramiko
46-
* wxPython (required for :mod:`fs.browsewin`) http://www.wxpython.org/
44+
* Boto (required for :mod:`~fs.s3fs`) https://github.com/boto/boto
45+
* Paramiko (required for :mod:`~fs.sftpfs`) https://github.com/paramiko/paramiko
46+
* wxPython (required for :mod:`~fs.browsewin`) http://www.wxpython.org/
4747

4848

4949
Quick Examples

docs/implementersguide.rst

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
.. _implementers:
22

3-
A Guide For Filesystem Implementers
3+
A Guide For Filesystem Implementers
44
===================================
55

66
PyFilesystem objects are designed to be as generic as possible and still expose the full filesystem functionality.
7-
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.
7+
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.
88

9-
To create a working PyFilesystem interface, derive a class from :py:class:`fs.base.FS` and implement the 9 :ref:`essential-methods`.
9+
To create a working PyFilesystem interface, derive a class from :py:class:`~fs.base.FS` and implement the 9 :ref:`essential-methods`.
1010
The base class uses these essential methods as a starting point for providing a lot of extra functionality,
1111
but in some cases the default implementation may not be the most efficient.
1212
For example, most filesystems have an atomic way of moving a file from one location to another without having to copy data,
1313
whereas the default implementation of :meth:`~fs.base.FS.move` method must copy all the bytes in the source file to the destination file.
14-
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:
14+
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:
1515

1616
* :meth:`~fs.base.FS.copy` copy a file
1717
* :meth:`~fs.base.FS.copydir` copy a directory
1818
* :meth:`~fs.base.FS.exists` check if a file / directory exists
19-
* :meth:`~fs.base.FS.getsyspath` get a system path for a given resource, if it exists
19+
* :meth:`~fs.base.FS.getsyspath` get a system path for a given resource, if it exists
2020
* :meth:`~fs.base.FS.move` move a file
2121
* :meth:`~fs.base.FS.movedir` move a directory
2222

2323
For network based filesystems (i.e. where the physical data is pulled over a network),
2424
there are a few methods which can reduce the number of round trips to the server,
2525
if an efficient implementation is provided:
26-
26+
2727
* :meth:`~fs.base.FS.listdirinfo` returns the directory contents and info dictionary in one call
28-
* :meth:`~fs.base.FS.ilistdir` a generator version of :meth:`~fs.base.FS.listdir`
28+
* :meth:`~fs.base.FS.ilistdir` a generator version of :meth:`~fs.base.FS.listdir`
2929
* :meth:`~fs.base.FS.ilistdirinfo` a generator version of :meth:`~fs.base.FS.listdirinfo`
3030

3131
The generator methods (beginning with ``i``) are intended for use with filesystems that contain a lot of files,
3232
where reading the directory in one go may be expensive.
3333

3434
Other methods in the :doc:`interface` are unlikely to require a non-default implementation,
35-
but there is nothing preventing you from implementing them -- just be careful to use the same signature and replicate expected functionality.
35+
but there is nothing preventing you from implementing them -- just be careful to use the same signature and replicate expected functionality.
3636

3737
Filesystem Errors
3838
-----------------
3939

40-
With the exception of the constructor, FS methods should throw :class:`fs.errors.FSError` exceptions in preference to any implementation-specific exception classes,
40+
With the exception of the constructor, FS methods should throw :class:`~fs.errors.FSError` exceptions in preference to any implementation-specific exception classes,
4141
so that generic exception handling can be written.
4242
The constructor *may* throw a non-FSError exception, if no appropriate FSError exists.
4343
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.::
5353
someapi.open(path, mode)
5454
except someapi.UnableToOpen, e:
5555
raise errors.ResourceNotFoundError(path=path, details=e)
56-
56+
5757
Any code written to catch the generic error, can also retrieve the original exception if it contains additional information.
5858

5959
Thread Safety
@@ -75,7 +75,7 @@ Implementations are also free to reserve a dotted namespace notation for themsel
7575
If you do this, please avoid generic terms as they may conflict with existing or future implementations.
7676
For example ``"bobs_ftpfs.author"``, rather than ``"ftpfs.author"``.
7777

78-
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.
78+
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.
7979
The default ``getmeta`` implementation will pull the meta values from this dictionary.
8080

8181
.. _essential-methods:
@@ -94,29 +94,29 @@ The following methods are required for a minimal Filesystem interface:
9494
* :meth:`~fs.base.FS.removedir` Remove an existing directory
9595
* :meth:`~fs.base.FS.rename` Atomically rename a file or directory
9696
* :meth:`~fs.base.FS.getinfo` Return information about the path e.g. size, mtime
97-
97+
9898

9999
.. _non-essential-methods:
100100

101101
Non - Essential Methods
102102
-----------------------
103103

104-
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:
104+
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:
105105

106106
* :meth:`~fs.base.FS.copy` Copy a file to a new location
107107
* :meth:`~fs.base.FS.copydir` Recursively copy a directory to a new location
108108
* :meth:`~fs.base.FS.desc` Return a short descriptive text regarding a path
109-
* :meth:`~fs.base.FS.exists` Check whether a path exists as file or directory
109+
* :meth:`~fs.base.FS.exists` Check whether a path exists as file or directory
110110
* :meth:`~fs.base.FS.listdirinfo` Get a directory listing along with the info dict for each entry
111111
* :meth:`~fs.base.FS.ilistdir` Generator version of the listdir method
112112
* :meth:`~fs.base.FS.ilistdirinfo` Generator version of the listdirinfo method
113113
* :meth:`~fs.base.FS.getpathurl` Get an external URL at which the given file can be accessed, if possible
114114
* :meth:`~fs.base.FS.getsyspath` Get a file's name in the local filesystem, if possible
115115
* :meth:`~fs.base.FS.getmeta` Get the value of a filesystem meta value, if it exists
116116
* :meth:`~fs.base.FS.getmmap` Gets an mmap object for the given resource, if supported
117-
* :meth:`~fs.base.FS.hassyspath` Check if a path maps to a system path (recognized by the OS)
118-
* :meth:`~fs.base.FS.haspathurl` Check if a path maps to an external URL
117+
* :meth:`~fs.base.FS.hassyspath` Check if a path maps to a system path (recognized by the OS)
118+
* :meth:`~fs.base.FS.haspathurl` Check if a path maps to an external URL
119119
* :meth:`~fs.base.FS.hasmeta` Check if a filesystem meta value exists
120-
* :meth:`~fs.base.FS.move` Move a file to a new location
121-
* :meth:`~fs.base.FS.movedir` Recursively move a directory to a new location
120+
* :meth:`~fs.base.FS.move` Move a file to a new location
121+
* :meth:`~fs.base.FS.movedir` Recursively move a directory to a new location
122122
* :meth:`~fs.base.FS.settimes` Sets the accessed and modified times of a path

docs/interface.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Filesystem Interface
44
====================
55

66
The following methods are available in all PyFilesystem implementation:
7-
7+
88
* :meth:`~fs.base.FS.close` Close the filesystem and free any resources
99
* :meth:`~fs.base.FS.copy` Copy a file to a new location
1010
* :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:
4747
* :meth:`~fs.base.FS.walkdirs` Returns an iterable of paths to sub-directories
4848
* :meth:`~fs.base.FS.walkfiles` Returns an iterable of file paths in a directory, and its sub-directories
4949

50-
See :py:class:`fs.base.FS` for the method signature and full details.
50+
See :py:class:`~fs.base.FS` for the method signature and full details.
5151

5252
If you intend to implement an FS object, see :ref:`implementers`.

docs/utilities.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ new FS implementations easier.
77

88
fs.path
99
-------
10-
Contains many utility functions for manipulating filesystem paths. See :mod:`fs.path`.
10+
Contains many utility functions for manipulating filesystem paths. See :mod:`~fs.path`.
1111

1212
fs.errors
1313
---------
14-
Contains all the standard error classes used by PyFilesystem, along with some useful error-handling decorators. See :mod:`fs.errors`.
14+
Contains all the standard error classes used by PyFilesystem, along with some useful error-handling decorators. See :mod:`~fs.errors`.
1515

1616
fs.filelike
1717
-----------
18-
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`.
18+
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`.
1919

2020
fs.remote
2121
---------
22-
Contains useful functions and classes for implementing remote filesystems. See :mod:`fs.remote`.
22+
Contains useful functions and classes for implementing remote filesystems. See :mod:`~fs.remote`.
2323

fs/appdirfs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
A collection of filesystems that map to application specific locations.
66
77
These classes abstract away the different requirements for user data across platforms,
8-
which vary in their conventions. They are all subclasses of :class:`fs.osfs.OSFS`,
8+
which vary in their conventions. They are all subclasses of :class:`~fs.osfs.OSFS`,
99
all that differs from `OSFS` is the constructor which detects the appropriate
1010
location given the name of the application, author name and other parameters.
1111

0 commit comments

Comments
 (0)