From bdf42ce6ae21da94acf062774002cd6bc4a65058 Mon Sep 17 00:00:00 2001 From: Peter Odding Date: Wed, 19 May 2010 21:10:52 +0200 Subject: [PATCH] Moved FUSE binding configuration to DedupFS constructor --- dedupfs.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dedupfs.py b/dedupfs.py index 8d8841e..5af526a 100755 --- a/dedupfs.py +++ b/dedupfs.py @@ -53,12 +53,7 @@ def main(): # {{{1 mount points. Execute "dedupfs -h" for a list of valid command-line options. """ - # Set the Python FUSE API version that this script was written against. - fuse.fuse_python_api = (0, 2) - dfs = DedupFS() - dfs.flags = 0 - dfs.multithreaded = 0 # A short usage message with the command-line options defined by dedupfs # itself (see the __init__() method of the DedupFS class) is automatically @@ -94,9 +89,16 @@ def __init__(self, *args, **kw): # {{{2 try: + # Set the Python FUSE API version. + fuse.fuse_python_api = (0, 2) + # Initialize the FUSE binding's internal state. fuse.Fuse.__init__(self, *args, **kw) + # Set some options required by the Python FUSE binding. + self.flags = 0 + self.multithreaded = 0 + # Initialize instance attributes. self.block_size = 1024 * 128 self.buffers = {}