From ac218a7c6b0dd7a1dc893884a4a5fb56819ff3f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Mon, 13 Jun 2005 11:53:41 +0000 Subject: [PATCH] * add extract file/dir functions, make it comply with the docs --- src/pisi/package.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/pisi/package.py b/src/pisi/package.py index c7255d76..186da8b7 100644 --- a/src/pisi/package.py +++ b/src/pisi/package.py @@ -6,15 +6,25 @@ class Package: """Package: PISI package class""" def __init__(self, packagefn, mode): self.filename = packagefn - self.mode = mode + self.mode = mode # bu gerekli mi? # etc. etc. def add_file(fn): """add a file to package""" def extract(outdir): - """extract package contents to directory""" + """extract entire package contents to directory""" + extract_dir('', outdir) # means package root + + def extract_file(path, outdir): + """extract file with path to outdir""" + + def extract_dir(dir, outdir): + """extract directory recursively""" def extract_PISI_files(outdir): """extract PISI control files: metadata.xml, files.xml, action scripts, etc.""" + extract_file('metadata.xml', outdir) + extract_file('files.xml', outdir) + extract_dir('Config', outdir)