Option parsing refactorization.

- Generic suboption parsing code separated into a dedicated classes
 - Implement FUSE option parsing by subclassing the aforementioned
   classes
This commit is contained in:
dzsekijo 2006-06-06 01:13:47 +00:00
parent a73715442c
commit 22d10fca48
3 changed files with 449 additions and 275 deletions

View file

@ -1,3 +1,8 @@
2006-06-06 Csaba Henk <csaba.henk@creo.hu>
* Option parsing refactorization:
- Generic suboption parsing code separated into a dedicated classes
- Implement FUSE option parsing by subclassing the aforementioned
classes
2006-06-04 Csaba Henk <csaba.henk@creo.hu>
* Added support for the rest of FUSE methods:
flush, fgetattr, ftruncate, access, getxattr, listxattr, setxattr,

710
fuse.py

File diff suppressed because it is too large Load diff

9
xmp.py
View file

@ -121,7 +121,7 @@ class Xmp(Fuse):
# if size == 0:
# # We are asked for size of the value.
# return len(val)
# return val
# return val
#
# def listxattr(self, path, size):
# # We use the "user" namespace to please XFS utils
@ -144,14 +144,14 @@ class Xmp(Fuse):
- f_bsize - preferred size of file blocks, in bytes
- f_frsize - fundamental size of file blcoks, in bytes
[if you have no idea, use the same as blocksize]
[if you have no idea, use the same as blocksize]
- f_blocks - total number of blocks in the filesystem
- f_bfree - number of free blocks
- f_files - total number of file inodes
- f_ffree - nunber of free file inodes
"""
return os.statvfs(self.root)
return os.statvfs(self.root)
def main(self, *a, **kw):
@ -210,7 +210,8 @@ Userspace nullfs-alike: mirror the filesystem tree from some point on.
server = Xmp(version="%prog " + fuse.__version__,
usage=usage,
dash_s_do='setsingle')
dash_s_do='setsingle',
fetch_mp=True)
server.parser.add_option(mountopt="root", metavar="PATH", default='/', type=str,
help="mirror filesystem from under PATH [default: %default]")