2 # vim: set ts=4 sts=4 sw=4 textwidth=92:
5 from RarslaveCommon import *
8 # This is a regular zip file type
10 # It will detect sets like the following:
17 # Where the PAR2 files protect a file named X.zip and/or ABC.zip.
20 def detect_ZIP (name_files, prot_files):
21 all_files = no_duplicates (name_files + prot_files)
22 return has_a_match ('^.*\.zip$', all_files)
25 class PAR2Set_ZIP (PAR2Set.PAR2Set):
30 def find_extraction_heads (self):
31 return find_matches ('^.*\.zip', self.all_files)
33 def extraction_function (self, file, todir):
34 ZIP_CMD = self.config_get_value ('commands', 'unzip')
36 cmd = ZIP_CMD % (file, todir)
37 ret = run_command (cmd)