Skip to content

Commit

Permalink
Merge branch 'master' of github.com:PyFilesystem/pyfilesystem2
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Nov 26, 2016
2 parents 1938b74 + 00a740b commit 9df9dd2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PyFilesystem2

Python Filesystem abstraction layer

![tests](https://travis-ci.org/PyFilesystem/pyfilesystem2.svg?branch=master) [![Coverage Status](https://coveralls.io/repos/github/PyFilesystem/pyfilesystem2/badge.svg)](https://coveralls.io/github/PyFilesystem/pyfilesystem2)
![tests](https://travis-ci.org/PyFilesystem/pyfilesystem2.svg?branch=master) [![Coverage Status](https://coveralls.io/repos/github/PyFilesystem/pyfilesystem2/badge.svg)](https://coveralls.io/github/PyFilesystem/pyfilesystem2) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/30ad6445427349218425d93886ade9ee)](https://www.codacy.com/app/will-mcgugan/pyfilesystem2?utm_source=github.com&utm_medium=referral&utm_content=PyFilesystem/pyfilesystem2&utm_campaign=Badge_Grade)

Think of PyFilesystem's ``FS`` objects as the next logical step to
Python's ``file`` objects. In the same way that file objects abstract a
Expand Down Expand Up @@ -31,13 +31,13 @@ projects_fs = open_fs('~/projects')
print(count_python_loc(projects_fs))
```

The line ``project_fs = open_fs('~/projects')`` opens an FS object that maps to the ``projects`` directory in your home folder. That object is used by ``counts_python_loc`` when counting lines of code.
The line ``project_fs = open_fs('~/projects')`` opens an FS object that maps to the ``projects`` directory in your home folder. That object is used by ``count_python_loc`` when counting lines of code.

If we later want to count the lines of Python code in a zip file, then we can make the following change::

```python
projects_fs = open_fs('zip://projects.zip')
```

This works because PyFileystem provides a simple consistent interface to anything that resembles a collection of files and directories.
No changes to ``count_python_loc`` are required, because PyFileystem provides a simple consistent interface to anything that resembles a collection of files and directories, including archives and network filesystems.

0 comments on commit 9df9dd2

Please sign in to comment.