summaryrefslogtreecommitdiff
path: root/obnamlib/plugins/show_plugin.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2013-10-21 19:30:45 +0100
committerLars Wirzenius <liw@liw.fi>2013-10-21 19:30:45 +0100
commit5c02c00948259cf5d276ee0bc07f72d80b0d18b6 (patch)
tree7fcf7c73396cefedd2158160deca059542cd36db /obnamlib/plugins/show_plugin.py
parent45dd7c6089f7b09d1f8a85ee35f8cc179393cd54 (diff)
downloadobnam-5c02c00948259cf5d276ee0bc07f72d80b0d18b6.tar.gz
Fix trailing slash bug for "obnam ls"
Reported-by: Biltong
Diffstat (limited to 'obnamlib/plugins/show_plugin.py')
-rw-r--r--obnamlib/plugins/show_plugin.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/obnamlib/plugins/show_plugin.py b/obnamlib/plugins/show_plugin.py
index 93aec835..b48f2534 100644
--- a/obnamlib/plugins/show_plugin.py
+++ b/obnamlib/plugins/show_plugin.py
@@ -157,9 +157,15 @@ class ShowPlugin(obnamlib.ObnamPlugin):
self.app.output.write(
'Generation %s (%s - %s)\n' % (gen, started, ended))
for ls_file in args:
+ ls_file = self.remove_trailing_slashes(ls_file)
self.show_objects(gen, ls_file)
self.repo.fs.close()
+ def remove_trailing_slashes(self, filename):
+ while filename.endswith('/') and filename != '/':
+ filename = filename[:-1]
+ return filename
+
def format_time(self, timestamp):
return time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(timestamp))