X-Git-Url: https://irasnyder.com/gitweb/?a=blobdiff_plain;f=PAR2Set%2FExtractFirstBase.py;h=6b8a661181c61cc36b056e4fb0051c979c02ece4;hb=2bfcd1533957e5ab9d48baa9860c4d5de2154a1f;hp=4ebbfc89c811519956472de44c746c397a9c7d6b;hpb=a41f0878f0745f3026f4f610eeb52cba42f03da1;p=rarslave2.git diff --git a/PAR2Set/ExtractFirstBase.py b/PAR2Set/ExtractFirstBase.py index 4ebbfc8..6b8a661 100644 --- a/PAR2Set/ExtractFirstBase.py +++ b/PAR2Set/ExtractFirstBase.py @@ -1,55 +1,68 @@ #!/usr/bin/env python # vim: set ts=4 sts=4 sw=4 textwidth=92: -import logging -import PAR2Set.Base -import rsutil.common +""" +Holds the ExtractFirstBase class. +""" + +__author__ = "Ira W. Snyder (devel@irasnyder.com)" +__copyright__ = "Copyright (c) 2006,2007 Ira W. Snyder (devel@irasnyder.com)" +__license__ = "GNU GPL v2 (or, at your option, any later version)" +# ExtractFirstBase.py # -# This is another base class for types that must -# run the extraction routine before the repair routine +# Copyright (C) 2006,2007 Ira W. Snyder (devel@irasnyder.com) # -# It will detect sets like the following: -# X.par2 -# X.vol0+1.par2 -# X.vol1+2.par2 -# X.part01.rar -# X.part02.rar -# X.part03.rar +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. # -# Where the PAR2 files protect a file named X.avi, but not the X.part01.rar -# (and other) files. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. # +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +import logging +import PAR2Set.Base +import rsutil.common class ExtractFirstBase (PAR2Set.Base.Base): + """Base class for PAR2Set types which run the extraction routine before + the repair routine""" def runAll (self): + """Run the extraction, repair, and delete stages""" # Extraction Stage ret = self.runExtract () - if ret != SUCCESS: + if ret != rsutil.common.SUCCESS: logging.critical ('Extraction stage failed for: %s' % self.p2file) - return -EEXTRACT + return -rsutil.common.EEXTRACT self.update_matches () # Repair Stage ret = self.runVerifyAndRepair () - if ret != SUCCESS: + if ret != rsutil.common.SUCCESS: logging.critical ('Repair stage failed for: %s' % self.p2file) - return -ECHECK + return -rsutil.common.ECHECK self.update_matches () # Deletion Stage ret = self.runDelete () - if ret != SUCCESS: + if ret != rsutil.common.SUCCESS: logging.critical ('Deletion stage failed for: %s' % self.p2file) - return -EDELETE + return -rsutil.common.EDELETE logging.info ('Successfully completed: %s' % self.p2file) - return SUCCESS + return rsutil.common.SUCCESS