summaryrefslogtreecommitdiff
path: root/obnamlib/plugins/fuse_plugin.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2014-02-23 19:05:48 +0000
committerLars Wirzenius <liw@liw.fi>2014-02-23 19:05:48 +0000
commit6a1a2e7de7cd9979484a8b3651453fb27ac79cae (patch)
tree812fa4052da05470cfe02b8300386aaaa8c81a07 /obnamlib/plugins/fuse_plugin.py
parent9b0f6e678bbe6723fc809701e71dc923eddc5d65 (diff)
downloadobnam-6a1a2e7de7cd9979484a8b3651453fb27ac79cae.tar.gz
Move get_gen_path to a class method
Diffstat (limited to 'obnamlib/plugins/fuse_plugin.py')
-rw-r--r--obnamlib/plugins/fuse_plugin.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/obnamlib/plugins/fuse_plugin.py b/obnamlib/plugins/fuse_plugin.py
index 82a2d98b..0bf338a1 100644
--- a/obnamlib/plugins/fuse_plugin.py
+++ b/obnamlib/plugins/fuse_plugin.py
@@ -294,18 +294,17 @@ class ObnamFuse(fuse.Fuse):
generations = [gen for gen in repo.list_generations()
if not repo.get_is_checkpoint(gen)]
- def gen_path_0(path):
- if path.count('/') == 1:
- gen = path[1:]
- return (int(gen), '/')
- else:
- gen, repopath = path[1:].split('/', 1)
- return (int(gen), '/' + repopath)
- self.get_gen_path = gen_path_0
-
self.rootstat, self.rootlist = self.multiple_root_list(generations)
tracing.trace('multiple rootlist=%r', self.rootlist)
+ def get_gen_path(self, path):
+ if path.count('/') == 1:
+ gen = path[1:]
+ return (int(gen), '/')
+ else:
+ gen, repopath = path[1:].split('/', 1)
+ return (int(gen), '/' + repopath)
+
def getattr(self, path):
try:
if path.count('/') == 1: