* add extract file/dir functions, make it comply with the docs
This commit is contained in:
+12
-2
@@ -6,15 +6,25 @@ class Package:
|
|||||||
"""Package: PISI package class"""
|
"""Package: PISI package class"""
|
||||||
def __init__(self, packagefn, mode):
|
def __init__(self, packagefn, mode):
|
||||||
self.filename = packagefn
|
self.filename = packagefn
|
||||||
self.mode = mode
|
self.mode = mode # bu gerekli mi?
|
||||||
# etc. etc.
|
# etc. etc.
|
||||||
|
|
||||||
def add_file(fn):
|
def add_file(fn):
|
||||||
"""add a file to package"""
|
"""add a file to package"""
|
||||||
|
|
||||||
def extract(outdir):
|
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):
|
def extract_PISI_files(outdir):
|
||||||
"""extract PISI control files: metadata.xml, files.xml,
|
"""extract PISI control files: metadata.xml, files.xml,
|
||||||
action scripts, etc."""
|
action scripts, etc."""
|
||||||
|
extract_file('metadata.xml', outdir)
|
||||||
|
extract_file('files.xml', outdir)
|
||||||
|
extract_dir('Config', outdir)
|
||||||
|
|||||||
Reference in New Issue
Block a user