2 # vim: set ts=4 sts=4 sw=4 textwidth=92:
5 Holds the ExtractFirstBase class.
8 __author__ = "Ira W. Snyder (devel@irasnyder.com)"
9 __copyright__ = "Copyright (c) 2006,2007 Ira W. Snyder (devel@irasnyder.com)"
10 __license__ = "GNU GPL v2 (or, at your option, any later version)"
14 # Copyright (C) 2006,2007 Ira W. Snyder (devel@irasnyder.com)
16 # This program is free software; you can redistribute it and/or modify
17 # it under the terms of the GNU General Public License as published by
18 # the Free Software Foundation; either version 2 of the License, or
19 # (at your option) any later version.
21 # This program is distributed in the hope that it will be useful,
22 # but WITHOUT ANY WARRANTY; without even the implied warranty of
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 # GNU General Public License for more details.
26 # You should have received a copy of the GNU General Public License
27 # along with this program; if not, write to the Free Software
28 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
34 class ExtractFirstBase (PAR2Set.Base.Base):
35 """Base class for PAR2Set types which run the extraction routine before
39 """Run the extraction, repair, and delete stages"""
42 ret = self.runExtract ()
44 if ret != rsutil.common.SUCCESS:
45 logging.critical ('Extraction stage failed for: %s' % self.p2file)
46 return -rsutil.common.EEXTRACT
48 self.update_matches ()
51 ret = self.runVerifyAndRepair ()
53 if ret != rsutil.common.SUCCESS:
54 logging.critical ('Repair stage failed for: %s' % self.p2file)
55 return -rsutil.common.ECHECK
57 self.update_matches ()
60 ret = self.runDelete ()
62 if ret != rsutil.common.SUCCESS:
63 logging.critical ('Deletion stage failed for: %s' % self.p2file)
64 return -rsutil.common.EDELETE
66 logging.info ('Successfully completed: %s' % self.p2file)
67 return rsutil.common.SUCCESS