Commit 2f6887fb by rfkelly0

spelling fixes

parent 4b97c220
......@@ -8,7 +8,7 @@ Sandboxing
FS objects are not permitted to work with any files / directories outside of the Filesystem they represent. If you attempt to open a file or directory outside the root of the FS (e.g. by using "../" in the path) you will get a ``ValueError``.
There is no concept of a current working directory in PyFilesystem, since it is a common source of bugs and not all filesytems even have such a notion. If you want to work with a sub-directory of a FS object, you can use the :meth:`~fs.base.FS.opendir` method which returns another FS object representing the sub-directory.
There is no concept of a current working directory in PyFilesystem, since it is a common source of bugs and not all filesystems even have such a notion. If you want to work with a sub-directory of a FS object, you can use the :meth:`~fs.base.FS.opendir` method which returns another FS object representing the sub-directory.
For example, consider the following directory structure. The directory `foo` contains two sub-directories; `bar` and `baz`::
......@@ -29,7 +29,7 @@ The `foo_fs` object can work with any of the contents of `bar` and `baz`, which
bar_fs = foo_fs.opendir('bar')
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 readment.txt and photo.jpg files are in the root::
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::
--bar
|--readme.txt
......@@ -54,7 +54,7 @@ When working with paths in FS objects, keep in mind the following:
* A double dot means 'previous directory'
Note that paths used by the FS interface will use this format, but the constructor or additional methods may not.
Notably the :mod:`~fs.osfs.OSFS` constructor which requires an OS path -- the format of which can be platform-dependant.
Notably the :mod:`~fs.osfs.OSFS` constructor which requires an OS path -- the format of which can be platform-dependent.
There are many helpful functions for working with paths in the :mod:`fs.path` module.
......
......@@ -17,6 +17,6 @@ An interface to Tahoe Least-Authority File System. See :mod:`fs.contrib.tahoela
BIG (BIG Archive File Format)
-----------------------------
A read-only interface to the BIG archive file format used in some EA games titles (e.g. Command & Conquery 4). See :mod:`fs.contrib.bigfs`
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`
fs.expose
=========
The ``fs.expose`` module contains a number of options for making an FS implementation available over the internet, or to other applications.
The ``fs.expose`` module contains a number of options for making an FS implementation available over the Internet, or to other applications.
.. toctree::
:maxdepth: 3
......
......@@ -50,7 +50,7 @@ Creates a temporary filesystem in an OS provided location. See :mod:`fs.tempfs`
Wrap
----
A collection of wrappers that add new behaviour / features to existing FS instances. See :mod:`fs.wrapfs`
A collection of wrappers that add new behavior / features to existing FS instances. See :mod:`fs.wrapfs`
Zip
......
......@@ -32,14 +32,14 @@ Prerequisites
PyFilesystem requires at least **Python 2.5**. 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.
* Boto (required for :mod:`fs.s3fs`) http://code.google.com/p/boto/
* Paramikio (required for :class:`fs.ftpfs.FTPFS`) http://www.lag.net/paramiko/
* Paramiko (required for :class:`fs.ftpfs.FTPFS`) http://www.lag.net/paramiko/
* wxPython (required for :mod:`fs.browsewin`) http://www.wxpython.org/
Quick Examples
--------------
Before you dive in to the API documentation, here are a few interesting things you can do with pyFilesystem.
Before you dive in to the API documentation, here are a few interesting things you can do with PyFilesystem.
The following will list all the files in your home directory::
......
......@@ -3,7 +3,7 @@
A Guide For Filesystem Implementers
===================================
PyFilesystems objects are designed to be as generic as possible and still expose the full filesystem functionality.
PyFilesystem objects are designed to be as generic as possible and still expose the full filesystem functionality.
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.
To create a working PyFilesystem interface, derive a class from :py:class:`fs.base.FS` and implement the 9 :ref:`essential-methods`.
......@@ -11,7 +11,7 @@ The base class uses these essential methods as a starting point for providing a
but in some cases the default implementation may not be the most efficient.
For example, most filesystems have an atomic way of moving a file from one location to another without having to copy data,
whereas the default implementation of :meth:`~fs.base.FS.move` method must copy all the bytes in the source file to the destination file.
Any of the :ref:`non-essential-methods` may be overriden, but efficient custom versions of the following methods will have the greatest impact on performance:
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:
* :meth:`~fs.base.FS.copy` copy a file
* :meth:`~fs.base.FS.copydir` copy a directory
......@@ -37,7 +37,7 @@ but there is nothing preventing you from implementing them -- just be careful to
Filesystem Errors
-----------------
With the exception of the constuctor, FS methods should throw :class:`fs.errors.FSError` exceptions in preference to any implementation-specific exception classes,
With the exception of the constructor, FS methods should throw :class:`fs.errors.FSError` exceptions in preference to any implementation-specific exception classes,
so that generic exception handling can be written.
The constructor *may* throw a non-FSError exception, if no appropriate FSError exists.
The rationale for this is that creating an FS interface may require specific knowledge,
......@@ -59,7 +59,7 @@ Any code written to catch the generic error, can also retrieve the original exce
Thread Safety
-------------
All PyFilesystems methods, other than the constructor, should be thread-safe where-ever possible.
All PyFilesystem methods, other than the constructor, should be thread-safe where-ever possible.
One way to do this is to pass ``threads_synchronize=True`` to the base constructor and use the :func:`~fs.base.synchronize` decorator to lock the FS object when a method is called.
If the implementation can not be made thread-safe for technical reasons, ensure that ``getmeta("thread_safe")`` returns ``False``.
......@@ -86,8 +86,8 @@ Essential Methods
The following methods are required for a minimal Filesystem interface:
* :meth:`~fs.base.FS.open` Opens a file for read/writing
* :meth:`~fs.base.FS.isfile` Check wether the path exists and is a file
* :meth:`~fs.base.FS.isdir` Check wether a path exists and is a directory
* :meth:`~fs.base.FS.isfile` Check whether the path exists and is a file
* :meth:`~fs.base.FS.isdir` Check whether a path exists and is a directory
* :meth:`~fs.base.FS.listdir` List the contents of a directory
* :meth:`~fs.base.FS.makedir` Create a new directory
* :meth:`~fs.base.FS.remove` Remove an existing file
......@@ -101,11 +101,11 @@ The following methods are required for a minimal Filesystem interface:
Non - Essential Methods
-----------------------
The following methods have default implementations in :py:class:`fs.base.FS` and aren't required for a functional FS interface. They may be overriden if an alternative implementation can be supplied:
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:
* :meth:`~fs.base.FS.copy` Copy a file to a new location
* :meth:`~fs.base.FS.copydir` Recursively copy a directory to a new location
* :meth:`~fs.base.FS.desc` Return a short destriptive text regarding a path
* :meth:`~fs.base.FS.desc` Return a short descriptive text regarding a path
* :meth:`~fs.base.FS.exists` Check whether a path exists as file or directory
* :meth:`~fs.base.FS.listdirinfo` Get a directory listing along with the info dict for each entry
* :meth:`~fs.base.FS.ilistdir` Generator version of the listdir method
......@@ -114,7 +114,7 @@ The following methods have default implementations in :py:class:`fs.base.FS` and
* :meth:`~fs.base.FS.getsyspath` Get a file's name in the local filesystem, if possible
* :meth:`~fs.base.FS.getmeta` Get the value of a filesystem meta value, if it exists
* :meth:`~fs.base.FS.getmmap` Gets an mmap object for the given resource, if supported
* :meth:`~fs.base.FS.hassyspath` Check if a path maps to a system path (recognised by the OS)
* :meth:`~fs.base.FS.hassyspath` Check if a path maps to a system path (recognized by the OS)
* :meth:`~fs.base.FS.haspathurl` Check if a path maps to an external URL
* :meth:`~fs.base.FS.hasmeta` Check if a filesystem meta value exists
* :meth:`~fs.base.FS.move` Move a file to a new location
......
......@@ -21,7 +21,7 @@ The following methods are available in all PyFilesystem implementation:
* :meth:`~fs.base.FS.getsyspath` Get a file's name in the local filesystem, if possible
* :meth:`~fs.base.FS.hasmeta` Check if a filesystem meta value exists
* :meth:`~fs.base.FS.haspathurl` Check if a path maps to an external URL
* :meth:`~fs.base.FS.hassyspath` Check if a path maps to a system path (recognised by the OS)
* :meth:`~fs.base.FS.hassyspath` Check if a path maps to a system path (recognized by the OS)
* :meth:`~fs.base.FS.ilistdir` Generator version of the :meth:`~fs.base.FS.listdir` method
* :meth:`~fs.base.FS.ilistdirinfo` Generator version of the :meth:`~fs.base.FS.listdirinfo` method
* :meth:`~fs.base.FS.isdir` Check whether a path exists and is a directory
......@@ -49,4 +49,4 @@ The following methods are available in all PyFilesystem implementation:
See :py:class:`fs.base.FS` for the method signature and full details.
If you intend to implement an FS object, see :ref:`implementers`.
\ No newline at end of file
If you intend to implement an FS object, see :ref:`implementers`.
......@@ -21,7 +21,7 @@ If you have any problems or questions, please contact the developers through one
Bugs
####
If you find a bug in PyFilesytem, please file an issue: http://code.google.com/p/pyfilesystem/issues/list
If you find a bug in PyFilesystem, please file an issue: http://code.google.com/p/pyfilesystem/issues/list
Discussion Group
################
......
Opening Filesystems
===================
Generally, when you want to work with the files and directories of any of the supported filesytems,
Generally, when you want to work with the files and directories of any of the supported filesystems,
you create an instance of the appropriate class. For example, the following opens the directory ``/foo/bar``::
from fs.osfs import OSFS
......@@ -17,9 +17,9 @@ In these situations you can use an *opener*, which is a generic way of specifyin
The ``fsopendir`` callable takes a string that identifies the filesystem with a URI syntax, but if called with a regular path will return an :class:`~fs.osfs.OSFS` instance.
To open a different kind of filesystem, precede the path with the required protocol.
For example, the following code opens an FTP filesystem rather than a directory on your harddrive::
For example, the following code opens an FTP filesystem rather than a directory on your hard-drive::
from fs.opener import fsopendir
my_fs = fsopendir('ftp://example.org/foo/bar')
For further information regarding filesystem openers see :doc:`opener`.
\ No newline at end of file
For further information regarding filesystem openers see :doc:`opener`.
......@@ -54,3 +54,173 @@ osfs
tempfs
TempFS
mkdtemp
del
iter
WatchableFS
Mixin
Filelike
Filesystems
utils
tempfile
SFTP
sftp
paramiko
hostname
SFTPClient
SFTPFS
AWS
src
dst
filesystem's
RPCFS
RPCFSServer
xmlrpc
setcontents
RemoteConnectionError
ConnectionManagerFS
CacheFS
mixin
CacheFSMixin
filesystems
trie
PathMap
wildcard
pathsplit
ValueError
abspath
ftp
config
URIs
builtin
Indices
UTF
sftpfs
RPC
rpcfs
basename
classmethod
writeable
os
getsyspath
MultiFS
multifs
ResourceNotFoundError
Unmounts
MountFS
mountfs
StringIO
memoryfs
httpfs
ftpfs
SpooledTemporaryFile
truncatable
filelike
EOF
FileLikeBase
readline
isatty
fileno
docstrings
Django
django
FSStorage
prepend
FSImportHook
uninstalls
Uninstall
bytecode
sourcecode
automagically
URLs
urls
importhook
xmlrpclib
RPFSInterface
SimpleXmlRPCServer
Twisted's
FSError
BaseSFTPServer
ThreadingMixin
SFTPServerInterface
auth
transport's
publickey
ServerInterface
MountProcess
dokan
FSOperations
FSOperationsClass
DOKAN
bitmask
unmounts
fsname
numthreads
Popen
OSError
autorun
pickleable
struct
SafetyFS
fusermount
fds
nowait
nothreads
PyFilesystem
getmmap
mmap
FileWrapper
py
pyc
RPCFSInterface
SimpleXMLRPCServer
SocketServer
TCPServer
auths
RequestHandler
ABI
ctypes
IOError
FileUploadManager
TahoeLAFS
api
tahoelafs
wxPython
browsewin
NullFile
writeline
SubFS
DestinationExistsError
builtins
datetime
bool
getinfo
NoSysPathError
str
namespaces
linux
github
McGugan
PyFilesystem's
OSX
SVN
Boto
Sandboxing
txt
mtime
ascii
symlink
namespace
fsls
fstree
fscat
fsinfo
fsmv
fsmount
fsserver
fscp
fsrm
fsmkdir
listdirinfo
override
overridden
readme
......@@ -84,4 +84,4 @@ if __name__ == "__main__":
udfs = UserDataFS('sexytime', appauthor='pyfs')
print udfs
udfs2 = UserDataFS('sexytime2', appauthor='pyfs', create=False)
print udfs2
\ No newline at end of file
print udfs2
......@@ -137,7 +137,7 @@ def synchronize(func):
class FS(object):
"""The base class for Filesystem abstraction objects.
An instance of a class derived from FS is an abstraction on some kind of filesytem, such as the OS filesystem or a zip file.
An instance of a class derived from FS is an abstraction on some kind of filesystem, such as the OS filesystem or a zip file.
"""
......@@ -268,7 +268,7 @@ class FS(object):
return True
def getsyspath(self, path, allow_none=False):
"""Returns the system path (a path recognised by the OS) if one is present.
"""Returns the system path (a path recognized by the OS) if one is present.
If the path does not map to a system path (and `allow_none` is False)
then a NoSysPathError exception is thrown. Otherwise, the system
......@@ -287,7 +287,7 @@ class FS(object):
return None
def hassyspath(self, path):
"""Check if the path maps to a system path (a path recognised by the OS).
"""Check if the path maps to a system path (a path recognized by the OS).
:param path: path to check
:returns: True if `path` maps to a system path
......@@ -361,7 +361,7 @@ class FS(object):
def exists(self, path):
"""Check if a path references a valid resource.
:param path: A path in the filessystem
:param path: A path in the filesystem
:rtype: bool
"""
......@@ -370,7 +370,7 @@ class FS(object):
def isdir(self, path):
"""Check if a path references a directory.
:param path: a path in the filessystem
:param path: a path in the filesystem
:rtype: bool
"""
......@@ -379,7 +379,7 @@ class FS(object):
def isfile(self, path):
"""Check if a path references a file.
:param path: a path in the filessystem
:param path: a path in the filesystem
:rtype: bool
"""
......@@ -433,12 +433,12 @@ class FS(object):
name and the info dict as returned by getinfo.
This method may be more efficient than calling
:py:meth:`~fs.base.FS.getinfo` on each individual item returned by :py:meth:`~fs.base.FS.listdir`, particularily
:py:meth:`~fs.base.FS.getinfo` on each individual item returned by :py:meth:`~fs.base.FS.listdir`, particularly
for network based filesystems.
:param path: root of the path to list
:param wildcard: filter paths that match this wildcard
:param dirs_only: only retrive directories
:param dirs_only: only retrieve directories
:type dirs_only: bool
:param files_only: only retrieve files
:type files_only: bool
......@@ -715,9 +715,9 @@ class FS(object):
:param chunk_size: Number of bytes to read and write in a chunk
:param progress_callback: A function that is called periodically
with the number of bytes written.
:param finished_callback: A fuction that is called when all data has been written
:param finished_callback: A function that is called when all data has been written
:param error_callback: A function that is called with an exception
object if any error occurrs during the copy process.
object if any error occurs during the copy process.
:returns: An event object that is set when the copy is complete, call
the `wait` method of this object to block until the data is written
......@@ -812,7 +812,7 @@ class FS(object):
:type wildcard: a string containing a wildcard (e.g. `*.txt`) or a callable that takes the file path and returns a boolean
:param dir_wildcard: if given, only walk directories that match the wildcard
:type dir_wildcard: a string containing a wildcard (e.g. `*.txt`) or a callable that takes the directory name and returns a boolean
:param search: a string dentifying the method used to walk the directories. There are two such methods:
:param search: a string identifying the method used to walk the directories. There are two such methods:
* ``"breadth"`` yields paths in the top directories first
* ``"depth"`` yields the deepest paths first
......@@ -910,7 +910,7 @@ class FS(object):
"""Like the 'walk' method but yields directories.
:param path: root path to start walking
:param wildcard: if given, only return dictories that match this wildcard
:param wildcard: if given, only return directories that match this wildcard
:type wildcard: A string containing a wildcard (e.g. `*.txt`) or a callable that takes the directory name and returns a boolean
:param search: same as the walk method
:param ignore_errors: ignore any errors reading the directory
......@@ -1170,7 +1170,7 @@ class FS(object):
tree = printtree
def browse(self):
"""Displays the FS tree in a graphical window (requires wxWidgets)"""
"""Displays the FS tree in a graphical window (requires wxPython)"""
from fs.browsewin import browse
browse(self)
......
......@@ -184,7 +184,7 @@ class NoMMapError(ResourceError):
def convert_fs_errors(func):
"""Function wrapper to convert FSError instances into OSErrors."""
"""Function wrapper to convert FSError instances into OSError."""
@wraps(func)
def wrapper(*args,**kwds):
try:
......@@ -221,7 +221,7 @@ def convert_fs_errors(func):
def convert_os_errors(func):
"""Function wrapper to convert OSError/IOError instances into FSErrors."""
"""Function wrapper to convert OSError/IOError instances into FSError."""
opname = func.__name__
@wraps(func)
def wrapper(self,*args,**kwds):
......
......@@ -6,7 +6,7 @@ Use an FS object for Django File Storage
This module exposes the class "FSStorage", a simple adapter for using FS
objects as Django storage objects. Simply include the following lines
in your setttings.py::
in your settings.py::
DEFAULT_FILE_STORAGE = fs.expose.django_storage.FSStorage
DEFAULT_FILE_STORAGE_FS = OSFS('foo/bar') # Or whatever FS
......
......@@ -90,7 +90,7 @@ import logging
logger = logging.getLogger("fs.expose.dokan")
# Options controlling the behaviour of the Dokan filesystem
# Options controlling the behavior of the Dokan filesystem
DOKAN_OPTION_DEBUG = 1
DOKAN_OPTION_STDERR = 2
DOKAN_OPTION_ALT_STREAM = 4
......@@ -249,7 +249,7 @@ def timeout_protect(func):
MIN_FH = 100
class FSOperations(object):
"""Object delegating all DOKAN_OPERTAIONS pointers to an FS object."""
"""Object delegating all DOKAN_OPERATIONS pointers to an FS object."""
def __init__(self, fs, fsname="Dokan FS", volname="Dokan Volume"):
if libdokan is None:
......@@ -854,7 +854,7 @@ def mount(fs, drive, foreground=False, ready_callback=None, unmount_callback=Non
If the keyword argument 'ready_callback' is provided, it will be called
when the filesystem has been mounted and is ready for use. Any additional
keyword arguments control the behaviour of the final dokan mount point.
keyword arguments control the behavior of the final dokan mount point.
Some interesting options include:
* numthreads: number of threads to use for handling Dokan requests
......@@ -944,7 +944,7 @@ class MountProcess(subprocess.Popen):
In order to be passed successfully to the new process, the FS object
must be pickleable. Since win32 has no fork() this restriction is not
likely to be lifted (see also the "multiprcessing" module)
likely to be lifted (see also the "multiprocessing" module)
This class has an extra attribute 'drive' giving the drive of the mounted
filesystem, and an extra method 'unmount' that will cleanly unmount it
......
......@@ -5,7 +5,7 @@ fs.expose.sftp
Expose an FS object over SFTP (via paramiko).
This module provides the necessary interfaces to expose an FS object over
SFTP, plugging into the infratructure provided by the 'paramiko' module.
SFTP, plugging into the infrastructure provided by the 'paramiko' module.
For simple usage, the class 'BaseSFTPServer' provides an all-in-one server
class based on the standard SocketServer module. Use it like so::
......@@ -65,7 +65,7 @@ def report_sftp_errors(func):
class SFTPServerInterface(paramiko.SFTPServerInterface):
"""SFTPServerInferface implementation that exposes an FS object.
"""SFTPServerInterface implementation that exposes an FS object.
This SFTPServerInterface subclass expects a single additional argument,
the fs object to be exposed. Use it to set up a transport subsystem
......@@ -226,12 +226,12 @@ class SFTPHandle(paramiko.SFTPHandle):
class SFTPRequestHandler(sockserv.StreamRequestHandler):
"""SockerServer RequestHandler subclass for BaseSFTPServer.
"""SocketServer RequestHandler subclass for BaseSFTPServer.
This RequestHandler subclass creates a paramiko Transport, sets up the
sftp subsystem, and hands off the the transport's own request handling
sftp subsystem, and hands off to the transport's own request handling
thread. Note that paramiko.Transport uses a separate thread by default,
so there is no need to use TreadingMixIn.
so there is no need to use ThreadingMixin.
"""
def handle(self):
......
......@@ -57,10 +57,10 @@ class FileLikeBase(object):
behave.
Subclasses then need only implement some subset of these methods for
rich file-like interface compatability. They may of course override
rich file-like interface compatibility. They may of course override
other methods as desired.
The class is missing the following attributes and methods, which dont
The class is missing the following attributes and methods, which don't
really make sense for anything but real files:
* fileno()
......@@ -663,10 +663,10 @@ class FileWrapper(FileLikeBase):
class StringIO(FileWrapper):
"""StringIO wrapper that more closely matches standard file behaviour.
"""StringIO wrapper that more closely matches standard file behavior.
This is a simple compatability wrapper around the native StringIO class
which fixes some corner-cases of its behaviour. Specifically:
This is a simple compatibility wrapper around the native StringIO class
which fixes some corner-cases of its behavior. Specifically:
* adding __enter__ and __exit__ methods
* having truncate(size) zero-fill when growing the file
......@@ -696,10 +696,10 @@ class StringIO(FileWrapper):
class SpooledTemporaryFile(FileWrapper):
"""SpooledTemporaryFile wrapper with some compatability fixes.
"""SpooledTemporaryFile wrapper with some compatibility fixes.
This is a simple compatability wrapper around the native SpooledTempFile
class which fixes some corner-cases of its behaviour. Specifically:
This is a simple compatibility wrapper around the native class of the
same name, fixing some corner-cases of its behavior. Specifically:
* have truncate() accept a size argument
* roll to disk is seeking past the max in-memory size
......
......@@ -2,14 +2,14 @@
fs.multifs
==========
A MultiFS is a filesytem composed of a sequence of other filesystems, where
A MultiFS is a filesystem composed of a sequence of other filesystems, where
the directory structure of each filesystem is overlaid over the previous
filesystem. When you attempt to access a file from the MultiFS it will try
each 'child' FS in order, until it either finds a path that exists or raises a
ResourceNotFoundError.
One use for such a filesystem would be to selectively override a set of files,
to customize behaviour. For example, to create a filesystem that could be used
to customize behavior. For example, to create a filesystem that could be used
to *theme* a web application. We start with the following directories::
......
......@@ -4,29 +4,41 @@ fs.opener
Open filesystems via a URI.
There are occasions when you want to specify a filesytem from the command line or in a config file.
This module enables that functionality, and can return an FS object given a URI like syntax (http://commons.apache.org/vfs/filesystems.html).
There are occasions when you want to specify a filesystem from the command line
or in a config file. This module enables that functionality, and can return an
FS object given a filesystem specification in a URI-like syntax (inspired by
the syntax of http://commons.apache.org/vfs/filesystems.html).
The `OpenerRegistry` class maps the protocol (file, ftp etc.) on to an Opener object, which returns an appropriate filesystem object and path.
You can create a custom opener registry that opens just the filesystems you require, or use the opener registry defined here (also called `opener`) that can open any supported filesystem.
The `parse` method of an `OpenerRegsitry` object returns a tuple of an FS object a path. Here's an example of how to use the default opener registry::
The `OpenerRegistry` class maps the protocol (file, ftp etc.) on to an Opener
object, which returns an appropriate filesystem object and path. You can
create a custom opener registry that opens just the filesystems you require, or
use the opener registry defined here (also called `opener`) that can open any
supported filesystem.
The `parse` method of an `OpenerRegsitry` object returns a tuple of an FS
object a path. Here's an example of how to use the default opener registry::
>>> from fs.opener import opener
>>> opener.parse('ftp://ftp.mozilla.org/pub')
(<fs.ftpfs.FTPFS object at 0x96e66ec>, u'pub')
You can use use the `opendir` method, which just returns an FS object. In the example above, `opendir` will return a FS object for the directory `pub`::
You can use use the `opendir` method, which just returns an FS object. In the
example above, `opendir` will return a FS object for the directory `pub`::
>>> opener.opendir('ftp://ftp.mozilla.org/pub')
<SubFS: <FTPFS ftp.mozilla.org>/pub>
If you are just interested in a single file, use the `open` method of a registry which returns a file-like object, and has the same signature as FS objects and the `open` builtin::
If you are just interested in a single file, use the `open` method of a registry
which returns a file-like object, and has the same signature as FS objects and
the `open` builtin::
>>> opener.open('ftp://ftp.mozilla.org/pub/README')
<fs.ftpfs._FTPFile object at 0x973764c>
The `opendir` and `open` methods can also be imported from the top-level of this module for sake of convenience.
To avoid shadowing the builtin `open` method, they are named `fsopendir` and `fsopen`. Here's how you might import them::
The `opendir` and `open` methods can also be imported from the top-level of
this module for sake of convenience. To avoid shadowing the builtin `open`
method, they are named `fsopendir` and `fsopen`. Here's how you might import
them::
from fs.opener import fsopendir, fsopen
......@@ -298,7 +310,7 @@ class Opener(object):
* `create_dir` if True then `get_fs` should attempt to silently create the directory references in path
In addition to `get_fs` an opener class should contain
two class attributes; names and desc. `names` is a list of protocols that
two class attributes: names and desc. `names` is a list of protocols that
list opener will opener. `desc` is an English description of the individual opener syntax.
"""
......
......@@ -70,7 +70,7 @@ class OSFS(OSFSXAttrMixin, OSFSWatchMixin, FS):
"""Expose the underlying operating-system filesystem as an FS object.
This is the most basic of filesystems, which simply shadows the underlaying
filesytem of the OS. Most of its methods simply defer to the corresponding
filesystem of the OS. Most of its methods simply defer to the matching
methods in the os and os.path modules.
"""
......
......@@ -5,8 +5,8 @@ fs.path
Useful functions for FS path manipulation.
This is broadly similar to the standard ``os.path`` module but works with
paths in the canonical format expected by all FS objects (forwardslash-separated,
optional leading slash).
paths in the canonical format expected by all FS objects (that is, separated
by forward slashes and with an optional leading slash).
"""
......@@ -167,7 +167,7 @@ def join(*paths):
"""Joins any number of paths together, returning a new path string.
This is a simple alias for the ``pathjoin`` function, allowing it to be
used as ``fs.path.join`` in direct correspondance with ``os.path.join``.
used as ``fs.path.join`` in direct correspondence with ``os.path.join``.
:param paths: Paths to join are given in positional arguments
"""
......@@ -178,7 +178,7 @@ def pathsplit(path):
"""Splits a path into (head, tail) pair.
This function splits a path into a pair (head, tail) where 'tail' is the
last pathname component and 'head' is all preceeding components.
last pathname component and 'head' is all preceding components.
:param path: Path to split
......@@ -202,7 +202,7 @@ def split(path):
"""Splits a path into (head, tail) pair.
This is a simple alias for the ``pathsplit`` function, allowing it to be
used as ``fs.path.split`` in direct correspondance with ``os.path.split``.
used as ``fs.path.split`` in direct correspondence with ``os.path.split``.
:param path: Path to split
"""
......@@ -355,7 +355,7 @@ class PathMap(object):
"""Dict-like object with paths for keys.
A PathMap is like a dictionary where the keys are all FS paths. It has
two main advantages over a standard dictionary. First, keys are normalised
two main advantages over a standard dictionary. First, keys are normalized
automatically::
>>> pm = PathMap()
......
......@@ -276,7 +276,7 @@ class ConnectionManagerFS(LazyFS):
and provide some convenience methods for dealing with its remote
connection state.
The boolean attribute 'connected' indicates whether the remote fileystem
The boolean attribute 'connected' indicates whether the remote filesystem
has an active connection, and is initially True. If any of the remote
filesystem methods raises a RemoteConnectionError, 'connected' will
switch to False and remain so until a successful remote method call.
......@@ -431,7 +431,7 @@ class CacheFSMixin(FS):
access to a remote filesystem. File and directory meta-data is cached
but the actual file contents are not.
If you want to add caching to an exising FS object, use the CacheFS
If you want to add caching to an existing FS object, use the CacheFS
class instead; it's an easy-to-use wrapper rather than a mixin.
This mixin class is provided for FS implementors who want to use
caching internally in their own classes.
......@@ -452,7 +452,7 @@ class CacheFSMixin(FS):
The optional keyword argument 'max_cache_size' specifies the maximum
number of entries to keep in the cache. To allow the cache to grow
unboundedly, set it to None. The default is 1000.
without bound, set it to None. The default is 1000.
"""
self.cache_timeout = kwds.pop("cache_timeout",1)
self.max_cache_size = kwds.pop("max_cache_size",1000)
......@@ -732,7 +732,7 @@ class CacheFSMixin(FS):
class CacheFS(CacheFSMixin,WrapFS):
"""Simple FS wraper to cache meta-data of a remote filesystems.
"""Simple FS wrapper to cache meta-data of a remote filesystems.
This FS mixin implements a simplistic cache that can help speed up
access to a remote filesystem. File and directory meta-data is cached
......
......@@ -99,7 +99,7 @@ class RPCFS(FS):
def __init__(self, uri, transport=None):
"""Constructor for RPCFS objects.
The only required argument is the uri of the server to connect
The only required argument is the URI of the server to connect
to. This will be passed to the underlying XML-RPC server proxy
object, along with the 'transport' argument if it is provided.
......
......@@ -396,7 +396,7 @@ class S3FS(FS):
def makedir(self,path,recursive=False,allow_recreate=False):
"""Create a directory at the given path.
The 'mode' argument is accepted for compatability with the standard
The 'mode' argument is accepted for compatibility with the standard
FS interface, but is currently ignored.
"""
s3path = self._s3path(path)
......
......@@ -70,7 +70,7 @@ class SFTPFS(FS):
"""SFTPFS constructor.
The only required argument is 'connection', which must be something
from which we can construct a paramiko.SFTPClient object. Possibile
from which we can construct a paramiko.SFTPClient object. Possible
values include:
* a hostname string
......@@ -78,8 +78,8 @@ class SFTPFS(FS):
* a paramiko.Transport instance
* a paramiko.Channel instance in "sftp" mode
The kwd argument 'root_path' specifies the root directory on the remote
machine - access to files outside this root wil be prevented.
The keyword argument 'root_path' specifies the root directory on the
remote machine - access to files outside this root will be prevented.
:param connection: a connection string
:param root_path: The root path to open
......@@ -88,8 +88,8 @@ class SFTPFS(FS):
:param username: Name of SFTP user
:param password: Password for SFTP user
:param pkey: Public key
:param agent_auth: attempt to authorise with the user's public keys
:param no_auth: attempt to log in without any kind of authorisation
:param agent_auth: attempt to authorize with the user's public keys
:param no_auth: attempt to log in without any kind of authorization
"""
......
......@@ -18,7 +18,7 @@ from fs import _thread_synchronize_default
class TempFS(OSFS):
"""Create a Filesystem in a tempory directory (with tempfile.mkdtemp),
"""Create a Filesystem in a temporary directory (with tempfile.mkdtemp),
and removes it when the TempFS object is cleaned up."""
_meta = { 'thread_safe' : True,
......
......@@ -449,7 +449,7 @@ class WatchableFS(WatchableFSMixin,WrapFS):
class PollingWatchableFS(WatchableFS):
"""FS wrapper simulating watcher callbacks by periodic polling.
This FS wrapper augments the funcionality of WatchableFS by periodically
This FS wrapper augments the functionality of WatchableFS by periodically
polling the underlying FS for changes. It is thus capable of detecting
changes made to the underlying FS via other interfaces, albeit with a
(configurable) delay to account for the polling interval.
......
......@@ -14,7 +14,7 @@ class HideDotFilesFS(WrapFS):
"""FS wrapper class that hides dot-files in directory listings.
The listdir() function takes an extra keyword argument 'hidden'
indicating whether hidden dot-files shoud be included in the output.
indicating whether hidden dot-files should be included in the output.
It is False by default.
"""
......
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