diff options
author | Lars Wirzenius <liw@liw.fi> | 2014-02-23 19:05:48 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2014-02-23 19:05:48 +0000 |
commit | 6a1a2e7de7cd9979484a8b3651453fb27ac79cae (patch) | |
tree | 812fa4052da05470cfe02b8300386aaaa8c81a07 /obnamlib/plugins/fuse_plugin.py | |
parent | 9b0f6e678bbe6723fc809701e71dc923eddc5d65 (diff) | |
download | obnam-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.py | 17 |
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: |