diff options
Diffstat (limited to 'summain')
-rwxr-xr-x | summain | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -150,10 +150,8 @@ class Summain(cliapp.Application): for filename in self.files(root): o = summainlib.FilesystemObject(filename, nn, pn, exclude) if relative: - name = self.relative_path(root, o) - else: - name = o['Name'] - yield name, o + o.relative = self.relative_path(root, o) + yield o['Name'], o def relative_path(self, root, o): '''Return a path that is relative to root, if possible. @@ -167,13 +165,12 @@ class Summain(cliapp.Application): root2 = root else: root2 = root + os.sep - pathname = o['Name'] - if pathname.startswith(root2): - return pathname[len(root2):] - elif pathname == root and o.isdir(): + if o.filename.startswith(root2): + return o.filename[len(root2):] + elif o.filename == root and o.isdir(): return '.' else: - return pathname + return o.filename def new_formatter(self, checksums, objects): table = { |