diff options
author | Ethan Estrada <ethan.estrada@gmail.com> | 2016-03-08 21:42:55 -0700 |
---|---|---|
committer | Ethan Estrada <ethan.estrada@gmail.com> | 2016-03-08 22:42:59 -0700 |
commit | 13b4af9b6e96ca5dbc88ecf732d77e68134a7472 (patch) | |
tree | 2df59c7a3a267a89557a3629d90dafed80d31db7 | |
parent | 454a21938bfaabd206dc168039f255a84e443e70 (diff) | |
download | fusepy-13b4af9b6e96ca5dbc88ecf732d77e68134a7472.tar.gz |
Fix octal integer literals in examples
The form of octal literals used is compatible with Python 2.6+ and
Python 3.
-rwxr-xr-x | examples/context.py | 8 | ||||
-rwxr-xr-x | examples/memory.py | 6 | ||||
-rwxr-xr-x | examples/memoryll.py | 2 |
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 |