2 # vim: set ts=4 sts=4 sw=4 textwidth=92:
5 Holds the ExtractFirstOldRAR class.
7 This module works with old-style rar sets which need to be extracted
8 before they are verified.
10 It will detect sets like the following:
20 Where the PAR2 files do not protect the rar files directly, but instead
21 protect the files contained inside the rar files.
24 __author__ = "Ira W. Snyder (devel@irasnyder.com)"
25 __copyright__ = "Copyright (c) 2006,2007 Ira W. Snyder (devel@irasnyder.com)"
26 __license__ = "GNU GPL v2 (or, at your option, any later version)"
28 # ExtractFirstOldRAR.py -- detect and work with a old-style rar set
30 # Copyright (C) 2006,2007 Ira W. Snyder (devel@irasnyder.com)
32 # This program is free software; you can redistribute it and/or modify
33 # it under the terms of the GNU General Public License as published by
34 # the Free Software Foundation; either version 2 of the License, or
35 # (at your option) any later version.
37 # This program is distributed in the hope that it will be useful,
38 # but WITHOUT ANY WARRANTY; without even the implied warranty of
39 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40 # GNU General Public License for more details.
42 # You should have received a copy of the GNU General Public License
43 # along with this program; if not, write to the Free Software
44 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
46 import PAR2Set.ExtractFirstBase
51 def detector (name_files, prot_files):
52 """Detects a ExtractFirstOldRAR set"""
54 return rsutil.common.has_a_match ('^.*\.r00$', name_files) \
55 and not rsutil.common.has_a_match ('^.*\.r00$', prot_files)
58 class ExtractFirstOldRAR (PAR2Set.ExtractFirstBase.ExtractFirstBase, \
59 PAR2Set.OldRAR.OldRAR):
61 """Class for old-style rar sets which must be extracted before repair"""
64 return 'EXTRACTFIRST OLDRAR'