Commit d06a0632 by willmcgugan@gmail.com

Docs

parent 8de30fd9
.. _commands:
Command Line Applications Command Line Applications
========================= =========================
......
...@@ -6,7 +6,7 @@ PyFilesystem is a Python-only module and can be installed from source or with `p ...@@ -6,7 +6,7 @@ PyFilesystem is a Python-only module and can be installed from source or with `p
Installing Installing
---------- ----------
To install with pip, use the following To install with pip, use the following::
pip install fs pip install fs
...@@ -26,6 +26,16 @@ Whichever method you use, you should now have the `fs` module on your path (vers ...@@ -26,6 +26,16 @@ Whichever method you use, you should now have the `fs` module on your path (vers
>>> fs.__version__ >>> fs.__version__
'0.5.0' '0.5.0'
You should also have the command line applications installed. If you enter the following in the command line, you should see a tree display of the current working directory::
fstree -l 2
Because the command line utilities use PyFilesystem, they also work with any of the supported filesystems. For example::
fstree ftp://ftp.mozilla.org -l 2
See :doc:`commands` for more information on the command line applications.
Prerequisites Prerequisites
------------- -------------
......
...@@ -10,7 +10,15 @@ Even if you only want to work with the local filesystem, PyFilesystem simplifies ...@@ -10,7 +10,15 @@ Even if you only want to work with the local filesystem, PyFilesystem simplifies
About PyFilesystem About PyFilesystem
------------------ ------------------
PyFilesystem was initially created by Will McGugan (http://www.willmcgugan.com) and is now a joint effort with Ryan Kelly (http://www.rfk.id.au/). PyFilesystem was initially created by Will McGugan and is now a joint effort from the following contributors:
- Will McGugan (http://www.willmcgugan.com)
- Ryan Kelly (http://www.rfx.id.au)
- Andrew Scheller
- Ben Timby
And many others who have contributed bug reports and patches.
Need Help? Need Help?
......
...@@ -3,7 +3,7 @@ Release Notes ...@@ -3,7 +3,7 @@ Release Notes
PyFilesystem has reached a point where the interface is relatively stable. The were some backwards incompatibilities introduced with version 0.5.0, due to Python 3 support. PyFilesystem has reached a point where the interface is relatively stable. The were some backwards incompatibilities introduced with version 0.5.0, due to Python 3 support.
Changes from 0.5.0 Changes from 0.4.0
------------------ ------------------
Python 3.X support was added. The interface has remained much the same, but the ``open`` method now works like Python 3's builtin, which handles text encoding more elegantly. i.e. if you open a file in text mode, you get a stream that reads or writes unicode rather than binary strings. Python 3.X support was added. The interface has remained much the same, but the ``open`` method now works like Python 3's builtin, which handles text encoding more elegantly. i.e. if you open a file in text mode, you get a stream that reads or writes unicode rather than binary strings.
...@@ -14,7 +14,7 @@ The new signature to the ``open`` method (and ``safeopen``) is as follows:: ...@@ -14,7 +14,7 @@ The new signature to the ``open`` method (and ``safeopen``) is as follows::
In order to keep the same signature across both Python 2 and 3, PyFilesystems uses the ``io`` module from the standard library. Unfortunately this is only available from Python 2.6 onwards, so Python 2.5 support has been dropped. If you need Python 2.5 support, consider sticking to PyFilesystem 0.4.0. In order to keep the same signature across both Python 2 and 3, PyFilesystems uses the ``io`` module from the standard library. Unfortunately this is only available from Python 2.6 onwards, so Python 2.5 support has been dropped. If you need Python 2.5 support, consider sticking to PyFilesystem 0.4.0.
By default the new ``open`` method now returns a unicode text stream, whereas 0.4.0 returned a binary file-like object. If you have code that runs on 0.4.0, you will probably want to either modify your code to work with unicode or explicitly open files in binary mode. The later is as simple as changing the mode from "r" to "rb" (or "w" to "wb"), but if you were working with unicode, the new text streams will likely save you a few lines of code. By default the new ``open`` method now returns a unicode text stream, whereas 0.4.0 returned a binary file-like object. If you have code that runs on 0.4.0, you will probably want to either modify your code to work with unicode or explicitly open files in binary mode. The latter is as simple as changing the mode from "r" to "rb" (or "w" to "wb"), but if you were working with unicode, the new text streams will likely save you a few lines of code.
The ``setcontents`` and ``getcontents`` methods have also grown a few parameters in order to work with text files. So you won't require an extra encode / decode step for text files. The ``setcontents`` and ``getcontents`` methods have also grown a few parameters in order to work with text files. So you won't require an extra encode / decode step for text files.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment