From d302e6765609392389b48be701998943975843bb Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 8 Aug 2011 14:51:34 +0100 Subject: Fix relative pathnames. --- summain | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'summain') diff --git a/summain b/summain index 717d398..233eff4 100755 --- a/summain +++ b/summain @@ -99,13 +99,13 @@ class Summain(cliapp.Application): for filename in self.files(root): o = summainlib.FilesystemObject(filename, nn, pn, exclude) if relative: - name = self.relative_path(root) + name = self.relative_path(root, o) else: name = o['Name'] fmt.write_object(name, o, checksums) fmt.close() - def relative_path(self, root): + def relative_path(self, root, o): '''Return a path that is relative to root, if possible. If pathname does not start with root, then return it @@ -120,7 +120,7 @@ class Summain(cliapp.Application): pathname = self['Name'] if pathname.startswith(root2): return pathname[len(root2):] - elif pathname == root and self._isdir(): + elif pathname == root and o.isdir(): return '.' else: return pathname -- cgit v1.2.1