scripts/dtrx

branch
trunk
changeset 51
f1789e6586d8
parent 49
c76dd2716113
child 52
cf191f957fd0
equal deleted inserted replaced
50:71bdbc1148af 51:f1789e6586d8
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):

mercurial