2 # vim: set ts=4 sts=4 sw=4 textwidth=92:
9 # This is another base class for types that must
10 # run the extraction routine before the repair routine
12 # It will detect sets like the following:
20 # Where the PAR2 files protect a file named X.avi, but not the X.part01.rar
24 class ExtractFirstBase (PAR2Set.Base.Base):
29 ret = self.runExtract ()
31 if ret != rsutil.common.SUCCESS:
32 logging.critical ('Extraction stage failed for: %s' % self.p2file)
33 return -rsutil.common.EEXTRACT
35 self.update_matches ()
38 ret = self.runVerifyAndRepair ()
40 if ret != rsutil.common.SUCCESS:
41 logging.critical ('Repair stage failed for: %s' % self.p2file)
42 return -rsutil.common.ECHECK
44 self.update_matches ()
47 ret = self.runDelete ()
49 if ret != rsutil.common.SUCCESS:
50 logging.critical ('Deletion stage failed for: %s' % self.p2file)
51 return -rsutil.common.EDELETE
53 logging.info ('Successfully completed: %s' % self.p2file)
54 return rsutil.common.SUCCESS