527 (options.overwrite and (contents != MATCHING_DIRECTORY))) |
527 (options.overwrite and (contents != MATCHING_DIRECTORY))) |
528 can_handle = staticmethod(can_handle) |
528 can_handle = staticmethod(can_handle) |
529 |
529 |
530 def organize(self): |
530 def organize(self): |
531 self.target = self.extractor.basename() |
531 self.target = self.extractor.basename() |
532 shutil.rmtree(self.target) |
532 if os.path.isdir(self.target): |
|
533 shutil.rmtree(self.target) |
533 os.rename(self.extractor.target, self.target) |
534 os.rename(self.extractor.target, self.target) |
534 |
535 |
535 |
536 |
536 class MatchHandler(BaseHandler): |
537 class MatchHandler(BaseHandler): |
537 def can_handle(contents, options): |
538 def can_handle(contents, options): |