diff --git a/README.new_fusepy_api b/README.new_fusepy_api index 7839c54..cf15955 100644 --- a/README.new_fusepy_api +++ b/README.new_fusepy_api @@ -95,7 +95,7 @@ Let's see how these are implemented. .. [#] See ``examples/xmp.py`` for the argument list of the fs methods. Regarding return values: in each method, you can signal success or - error by returning ``0`` (*succes*), a negative number (*error*, + error by returning ``0`` (*success*), a negative number (*error*, interpreted as negated errno), not returning anything (*success*) or by raising (not catching) an exception (*error*, Python infers an errno from the nature of the exception). @@ -197,7 +197,7 @@ Simple objects to represent system structures In old Pythons, ``os.stat()`` returned file attributes as a tuple, and for the convenient access of the stat values, you got a bunch of -constats with it (so you queried file size like +constants with it (so you queried file size like ``os.stat("foofile")[stat.ST_SIZE]``). While this approach still works, and if you print a stat result, it looks like a tuple, *it is, in fact, not a tuple*. It's an object which is immutable and provides the @@ -219,8 +219,8 @@ Similarly, when listing directories, you have to return a sequence of ``fuse.Direntry`` objects which can be constructed from filenames (``fuse.Direntry("foofile")``). -Does the above senctence make sense? I hope so. Anyway, *it's not true -as is*. (Truth has been sacrified for making it short.) Don't worry, we +Does the above sentence make sense? I hope so. Anyway, *it's not true +as is*. (Truth has been sacrificed for making it short.) Don't worry, we uncover the lies immediately: - *You don't necessarily have to return a sequence*. You just have to @@ -247,7 +247,7 @@ so called *filehandle*. [#]_ FUSE internally will allocate a (FUSE) filehandle upon open, and keep a record of your (Python) filehandle. When the system will want to use the FUSE filehandle for I/O, the respective Python method will get the (py-)filehandle as an argument. -Ie., you can use the filehandle to preserve a state. +I.e., you can use the filehandle to preserve a state. You might as well want the filehandle to be an instance of a dedicated class, and want the filesystem methods get delegated to the filehandle. @@ -287,7 +287,7 @@ Complete support for hi-lib The Python bindings support all highlevel (pathname based) methods of the Fuse library as of API revision 26, including `create`, `access`, `flush`, extended attributes, advisory file locking, nanosec precise -setting of acces/modify times, and `bmap`. +setting of access/modify times, and `bmap`. Reflection @@ -327,6 +327,6 @@ Long-term compatibility Your filesystem is expected to set ``fuse.fuse_python_api`` in order to make it easy for the fuse module to find out the which FUSE-Python API revision is appropriate for your code. Concretely, set ``fuse.fuse_python_api`` -to the value of ``fuse.FUSE_PYTHON_API_VERSION`` as it's definied in the fuse.pyi +to the value of ``fuse.FUSE_PYTHON_API_VERSION`` as it's defined in the fuse.pyi instance you code your filesystem against. This ensures that your code will keep working even if further API revisions take place. diff --git a/example/_find_fuse_parts.py b/example/_find_fuse_parts.py index 6300865..9c70de9 100644 --- a/example/_find_fuse_parts.py +++ b/example/_find_fuse_parts.py @@ -1,4 +1,4 @@ -import sys, os, glob +import sys, glob from os.path import realpath, dirname, join from traceback import format_exception diff --git a/example/xmp.py b/example/xmp.py index ad2b16b..c33428f 100644 --- a/example/xmp.py +++ b/example/xmp.py @@ -110,7 +110,7 @@ def utime(self, path, times): # The following utimens method would do the same as the above utime method. # We can't make it better though as the Python stdlib doesn't know of -# subsecond preciseness in acces/modify times. +# sub-second preciseness in access/modify times. # # def utimens(self, path, ts_acc, ts_mod): # os.utime("." + path, (ts_acc.tv_sec, ts_mod.tv_sec)) @@ -134,7 +134,7 @@ def access(self, path, mode): # # We use the "user" namespace to please XFS utils # aa = ["user." + a for a in ("foo", "bar")] # if size == 0: -# # We are asked for size of the attr list, ie. joint size of attrs +# # We are asked for size of the attr list, i.e. joint size of attrs # # plus null separators. # return len("".join(aa)) + len(aa) # return aa @@ -146,7 +146,7 @@ def statfs(self): If you are not reusing an existing statvfs object, start with fuse.StatVFS(), and define the attributes. - To provide usable information (ie., you want sensible df(1) + To provide usable information (i.e., you want sensible df(1) output, you are suggested to specify the following attributes: - f_bsize - preferred size of file blocks, in bytes