From 90ceb5b2e73af8c795004e33a932a28678508e13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Mon, 13 Jun 2005 13:50:06 +0000 Subject: [PATCH] =?UTF-8?q?Archive=20i=C3=A7in=20bir=20deneme...=20tests?= =?UTF-8?q?=20i=C3=A7erisindekileri=20unittest'e=20ta=C5=9F=C4=B1may=C4=B1?= =?UTF-8?q?=20ciddi=20ciddi=20d=C3=BC=C5=9F=C3=BCn=C3=BCyoruz=20(=C5=9Fimd?= =?UTF-8?q?ilik=20sadece=20d=C3=BC=C5=9F=C3=BCn=C3=BCyoruz...)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pisi/archive.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/pisi/archive.py b/src/pisi/archive.py index 3bd94a25..0517ca44 100644 --- a/src/pisi/archive.py +++ b/src/pisi/archive.py @@ -2,14 +2,19 @@ # maintainer: baris and meren import tarfile +import zipfile import config -class ArchiveTarFile: +class ArchiveBase(object): def __init__(self, filename, type): self.type = type self.filename = filename +class ArchiveTarFile(ArchiveBase): + def __init__(self, filename, type): + super(ArchiveTarFile, self).__init__(filename, type) + def unpack(self): if self.type == "targz": tar = tarfile.open(config.archives_dir()+"/"+self.filename, 'r:gz') @@ -17,9 +22,12 @@ class ArchiveTarFile: tar.extract(tarinfo) tar.close() -class ArchiveZip: - pass +class ArchiveZip(ArchiveBase): + def __init__(self, filename, type): + super(ArchiveZip, self).__init__(filename, type) + def unpack(self): + print "lolo" class Archive: """Unpack magic for Archive files..."""