* we should read a file without extracting it to somewhere

This commit is contained in:
Faik Uygur
2006-09-28 07:35:48 +00:00
parent 43144be9c1
commit 578135a71c
+3
View File
@@ -308,6 +308,9 @@ class ArchiveZip(ArchiveBase):
""" Returns true if file_path is member of the zip archive"""
return file_path in self.zip_obj.namelist()
def read_file(self, file_path):
return self.zip_obj.read(file_path)
def unpack_file_cond(self, pred, target_dir, archive_root = ''):
"""Unpack/Extract files according to predicate function
pred: filename -> bool