diff options
author | Lars Wirzenius <liw@liw.fi> | 2012-03-12 17:46:38 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2012-03-12 17:46:38 +0000 |
commit | 06499854f13ef086f8a374e92d1b7f8dfa03158c (patch) | |
tree | d81f98031ef6433fdc15c0fb0da96bb74537ce97 | |
parent | 08627e99f7c4452b077bbdfabdb7094fff9e79ca (diff) | |
download | dupfiles-06499854f13ef086f8a374e92d1b7f8dfa03158c.tar.gz |
Show progress during removal
-rwxr-xr-x | dupfiles | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -266,11 +266,18 @@ class Dupfiles(cliapp.Application): else: keep = duplicates.pop() + ts = ttystatus.TerminalStatus(period=0.1) + ts['filenames'] = duplicates + ts.format('removing %Index(filename,filenames)') + for pathname in duplicates: + ts['filename'] = pathname if self.settings['no-act']: self.output.write('rm %s\n' % pathname) else: os.remove(pathname) + + ts.finish() def report(self, duplicates): sys.stdout.write('\n'.join(duplicates)) |