summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTerence Honles <terence@honles.com>2016-03-14 14:55:46 -0700
committerTerence Honles <terence@honles.com>2016-03-14 14:55:46 -0700
commitd9c307f1cadeeafff69408d25d0aed48d2181d79 (patch)
tree2df59c7a3a267a89557a3629d90dafed80d31db7
parent454a21938bfaabd206dc168039f255a84e443e70 (diff)
parent13b4af9b6e96ca5dbc88ecf732d77e68134a7472 (diff)
downloadfusepy-d9c307f1cadeeafff69408d25d0aed48d2181d79.tar.gz
Merge pull request #43 from eestrada/master
Fix octal integer literals in examples
-rwxr-xr-xexamples/context.py8
-rwxr-xr-xexamples/memory.py6
-rwxr-xr-xexamples/memoryll.py2
3 files changed, 8 insertions, 8 deletions
diff --git a/examples/context.py b/examples/context.py
index aa8ab76..40fa168 100755
--- a/examples/context.py
+++ b/examples/context.py
@@ -14,16 +14,16 @@ class Context(LoggingMixIn, Operations):
def getattr(self, path, fh=None):
uid, gid, pid = fuse_get_context()
if path == '/':
- st = dict(st_mode=(S_IFDIR | 0755), st_nlink=2)
+ st = dict(st_mode=(S_IFDIR | 0o755), st_nlink=2)
elif path == '/uid':
size = len('%s\n' % uid)
- st = dict(st_mode=(S_IFREG | 0444), st_size=size)
+ st = dict(st_mode=(S_IFREG | 0o444), st_size=size)
elif path == '/gid':
size = len('%s\n' % gid)
- st = dict(st_mode=(S_IFREG | 0444), st_size=size)
+ st = dict(st_mode=(S_IFREG | 0o444), st_size=size)
elif path == '/pid':
size = len('%s\n' % pid)
- st = dict(st_mode=(S_IFREG | 0444), st_size=size)
+ st = dict(st_mode=(S_IFREG | 0o444), st_size=size)
else:
raise FuseOSError(ENOENT)
st['st_ctime'] = st['st_mtime'] = st['st_atime'] = time()
diff --git a/examples/memory.py b/examples/memory.py
index a103185..b2b2a5d 100755
--- a/examples/memory.py
+++ b/examples/memory.py
@@ -21,11 +21,11 @@ class Memory(LoggingMixIn, Operations):
self.data = defaultdict(bytes)
self.fd = 0
now = time()
- self.files['/'] = dict(st_mode=(S_IFDIR | 0755), st_ctime=now,
+ self.files['/'] = dict(st_mode=(S_IFDIR | 0o755), st_ctime=now,
st_mtime=now, st_atime=now, st_nlink=2)
def chmod(self, path, mode):
- self.files[path]['st_mode'] &= 0770000
+ self.files[path]['st_mode'] &= 0o770000
self.files[path]['st_mode'] |= mode
return 0
@@ -103,7 +103,7 @@ class Memory(LoggingMixIn, Operations):
return dict(f_bsize=512, f_blocks=4096, f_bavail=2048)
def symlink(self, target, source):
- self.files[target] = dict(st_mode=(S_IFLNK | 0777), st_nlink=1,
+ self.files[target] = dict(st_mode=(S_IFLNK | 0o777), st_nlink=1,
st_size=len(source))
self.data[target] = source
diff --git a/examples/memoryll.py b/examples/memoryll.py
index 307a1af..1f04df2 100755
--- a/examples/memoryll.py
+++ b/examples/memoryll.py
@@ -21,7 +21,7 @@ class Memory(FUSELL):
self.parent = {}
self.children = defaultdict(dict)
- self.attr[1] = {'st_ino': 1, 'st_mode': S_IFDIR | 0777, 'st_nlink': 2}
+ self.attr[1] = {'st_ino': 1, 'st_mode': S_IFDIR | 0o777, 'st_nlink': 2}
self.parent[1] = 1
forget = None