+ def cleanup (self, preserved):
+ global counter
+ counter+=1
+ src = os.path.abspath(os.path.basename(self.path()));
+ if self.options.destination:
+ dst = os.path.abspath(self.options.destination) + '/' + os.path.basename(self.path())
+ if self.options.verbose:
+ print "moving %s\n\tto %s"%(self.path(), dst)
+ if not self.options.dry_run:
+ os.rename (src, dst)
+ else:
+ if self.options.verbose:
+ print "Would cleanup %s"%(src)
+ print " (keeping %s)"%preserved.path()
+ if not self.options.dry_run:
+ if self.options.verbose: print "unlink",src
+ os.unlink (src)
+