From 8659a38ed414b17d2d522f451ef7cad2ae85840f Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Tue, 23 May 2006 19:53:59 +0000 Subject: [PATCH] a tiny helper for zip archive --- pisi/archive.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pisi/archive.py b/pisi/archive.py index 8ec89842..1f692998 100644 --- a/pisi/archive.py +++ b/pisi/archive.py @@ -182,6 +182,10 @@ class ArchiveZip(ArchiveBase): self.add_to_archive(file_name) os.chdir(cwd) + def has_file(self, file_path): + """ Returns true if file_path is member of the zip archive""" + return file_path in self.zip_obj.namelist() + def unpack_file_cond(self, pred, target_dir, archive_root = ''): """Unpack/Extract files according to predicate function pred: filename -> bool