aboutsummaryrefslogtreecommitdiffstats
path: root/fusearchive.py
diff options
context:
space:
mode:
Diffstat (limited to 'fusearchive.py')
-rwxr-xr-xfusearchive.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/fusearchive.py b/fusearchive.py
index f7fd595..4a860ee 100755
--- a/fusearchive.py
+++ b/fusearchive.py
@@ -8,10 +8,7 @@
# See the file COPYING.
#
-import os, sys, shutil, fcntl, fuse, re
-import tempfile, sha, cPickle, gzip
-from errno import *
-from stat import *
+import os, sys, fcntl, fuse, sha, cPickle, gzip, errno
from fuse import Fuse
import pdb
@@ -104,7 +101,7 @@ def save_chunk( chunk ):
dmsg( 3, "No block here, creating new block" )
savechunk = FuseArchiveStream.open( checkpath, "wb" )
savechunk.write( chunk )
- savechunk.close
+ savechunk.close()
break
dmsg( 3, "Got chunk slot: " + str( sub ) )
@@ -115,10 +112,10 @@ def load_chunk( key ):
if magic_profiling:
return ''
- ( hash, seq ) = key
+ ( thash, seq ) = key
dmsg( 2, "Begin load_chunk" )
- chars = list( hash )
+ chars = list( thash )
dmsg( 4, chars )
# Todo: make a digest -> path function to share with deflate
@@ -268,7 +265,7 @@ class FuseArchive(Fuse):
def access(self, path, mode):
if not os.access("./tree" + path, mode):
- return -EACCES
+ return -errno.EACCES
# This is how we could add stub extended attribute handlers...
# (We can't have ones which aptly delegate requests to the underlying fs
@@ -655,14 +652,14 @@ class FuseArchive(Fuse):
fcntl.F_RDLCK : fcntl.LOCK_SH,
fcntl.F_WRLCK : fcntl.LOCK_EX }[kw['l_type']]
if cmd == fcntl.F_GETLK:
- return -EOPNOTSUPP
+ return -errno.EOPNOTSUPP
elif cmd == fcntl.F_SETLK:
if op != fcntl.LOCK_UN:
op |= fcntl.LOCK_NB
elif cmd == fcntl.F_SETLKW:
pass
else:
- return -EINVAL
+ return -errno.EINVAL
fcntl.lockf(self.fd, op, kw['l_start'], kw['l_len'])