Skip to content

Commit b71cacd

Browse files
authored
Merge pull request #502 from PyFilesystem/update-docs
Update documentation for `v2.4.14`
2 parents f3ffa94 + 86c5370 commit b71cacd

File tree

5 files changed

+29
-3
lines changed

5 files changed

+29
-3
lines changed

CONTRIBUTORS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Many thanks to the following developers for contributing to this project:
66
- [Andreas Tollkötter](https://github.com/atollk)
77
- [Andrew Scheller](https://github.com/lurch)
88
- [Andrey Serov](https://github.com/zmej-serow)
9+
- [Ben Lindsay](https://github.com/benlindsay)
910
- [Bernhard M. Wiedemann](https://github.com/bmwiedemann)
1011
- [@chfw](https://github.com/chfw)
1112
- [Dafna Hirschfeld](https://github.com/kamomil)
@@ -17,6 +18,7 @@ Many thanks to the following developers for contributing to this project:
1718
- [George Macon](https://github.com/gmacon)
1819
- [Giampaolo Cimino](https://github.com/gpcimino)
1920
- [@Hoboneer](https://github.com/Hoboneer)
21+
- [Jon Hagg](https://github.com/jon-hagg)
2022
- [Joseph Atkins-Turkish](https://github.com/Spacerat)
2123
- [Joshua Tauberer](https://github.com/JoshData)
2224
- [Justin Charlong](https://github.com/jcharlong)

docs/source/extension.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ Here's an example taken from an Amazon S3 Filesystem::
2929

3030
__all__ = ['S3FSOpener']
3131

32-
from fs.opener import Opener, OpenerError
32+
from fs.opener import Opener
33+
from fs.opener.errors import OpenerError
3334

3435
from ._s3fs import S3FS
3536

docs/source/openers.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,25 @@ To open a filesysem with a FS URL, you can use :meth:`~fs.opener.registry.Regist
5656

5757
from fs import open_fs
5858
projects_fs = open_fs('osfs://~/projects')
59+
60+
61+
Manually registering Openers
62+
----------------------------
63+
64+
The ``fs.opener`` registry uses an entry point to install external openers
65+
(see :ref:`extension`), and it does so once, when you import `fs` for the first
66+
time. In some rare cases where entry points are not available (for instance,
67+
when running an embedded interpreter) or when extensions are installed *after*
68+
the interpreter has started (for instance in a notebook, see
69+
`PyFilesystem2#485 <https://github.com/PyFilesystem/pyfilesystem2/issues/485>`_).
70+
71+
However, a new opener can be installed manually at any time with the
72+
`fs.opener.registry.install` method. For instance, here's how the opener for
73+
the `s3fs <https://github.com/PyFilesystem/s3fs>`_ extension can be added to
74+
the registry::
75+
76+
import fs.opener
77+
from fs_s3fs.opener import S3FSOpener
78+
79+
fs.opener.registry.install(S3FSOpener)
80+
# fs.open_fs("s3fs://...") should now work

fs/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,8 @@ def geturl(self, path, purpose="download"):
910910
to retrieve for the given path (if there is more than
911911
one). The default is ``'download'``, which should return
912912
a URL that serves the file. Other filesystems may support
913-
other values for ``purpose``.
913+
other values for ``purpose``: for instance, `OSFS` supports
914+
``'fs'``, which returns a FS URL (see :ref:`fs-urls`).
914915
915916
Returns:
916917
str: a URL.

fs/subfs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
@six.python_2_unicode_compatible
2323
class SubFS(WrapFS[_F], typing.Generic[_F]):
24-
"""A sub-directory on another filesystem.
24+
"""A sub-directory on a parent filesystem.
2525
2626
A SubFS is a filesystem object that maps to a sub-directory of
2727
another filesystem. This is the object that is returned by

0 commit comments

Comments
 (0)