2 # vim: set ts=4 sts=4 sw=4 textwidth=92:
9 # This is a class that will only repair and delete, not extract
11 # It will detect sets like the following:
19 # Where the PAR2 files protect the mp3 files.
22 def detector (name_files, prot_files):
23 EXTRACT_REGEX = rsutil.common.config_get_value ('regular expressions', 'extractable_regex')
24 return not rsutil.common.has_a_match (EXTRACT_REGEX, prot_files)
27 class NoExtract (PAR2Set.Base.Base):
35 ret = self.runVerifyAndRepair ()
37 if ret != rsutil.common.SUCCESS:
38 logging.critical ('Repair stage failed for: %s' % self.p2file)
39 return -rsutil.common.ECHECK
41 self.update_matches ()
44 ret = self.runDelete ()
46 if ret != rsutil.common.SUCCESS:
47 logging.critical ('Deletion stage failed for: %s' % self.p2file)
48 return -rsutil.common.EDELETE
50 logging.info ('Successfully completed: %s' % self.p2file)
51 return rsutil.common.SUCCESS