Skip to content

Commit c766dd8

Browse files
committed
ftp tests, and doc refactor
1 parent a277dc8 commit c766dd8

24 files changed

+166
-55
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.DS_Store
2+
13
# Byte-compiled / optimized / DLL files
24
__pycache__/
35
*.py[cod]

docs/source/builtin.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Builtin Filesystems
44
.. toctree::
55
:maxdepth: 3
66

7-
ftpfs.rst
8-
memoryfs.rst
9-
mountfs.rst
10-
multifs.rst
11-
osfs.rst
12-
subfs.rst
7+
reference/ftpfs.rst
8+
reference/memoryfs.rst
9+
reference/mountfs.rst
10+
reference/multifs.rst
11+
reference/osfs.rst
12+
reference/subfs.rst

docs/source/guide.rst

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
PyFilesystem Guide
2-
==================
1+
Guide
2+
=====
33

44
The PyFilesytem interface simplifies most aspects of working with files and directories, even for quite simple operations. This guide covers how to work with PyFilesystem objects.
55

@@ -145,6 +145,21 @@ The :class:`fs.base.FS.makedir` and :class:`fs.base.FS.makedirs` methods also re
145145

146146
Working with ``SubFS`` objects means that you can generally avoid writing much path manipulation code, which tends to be error prone.
147147

148+
Walking
149+
~~~~~~~
150+
151+
Often you will need to scan the files in a given directory, and any sub-directories. This is known as *walking* the filesystem.
152+
153+
Here's how you would print the paths to all your Python files in your home-directory (and sub-directories)::
154+
155+
>>> from fs import open_fs
156+
>>> from fs import walk
157+
>>> home_fs = open_fs(~/)
158+
>>> for path in walk(home_fs, wildcards=['*.py']):
159+
... print(path)
160+
161+
This might take a while to run, if you have a lot of Python code!
162+
148163
Working with Files
149164
~~~~~~~~~~~~~~~~~~
150165

docs/source/reference.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ Reference
44
.. toctree::
55
:maxdepth: 3
66

7-
base.rst
8-
copy.rst
9-
errors.rst
10-
enums.rst
11-
info_objects.rst
12-
move.rst
13-
opener.rst
14-
path.rst
15-
tree.rst
16-
walk.rst
7+
reference/base.rst
8+
reference/copy.rst
9+
reference/errors.rst
10+
reference/enums.rst
11+
reference/info_objects.rst
12+
reference/move.rst
13+
reference/opener.rst
14+
reference/path.rst
15+
reference/tree.rst
16+
reference/walk.rst
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)