Ejemplo n.º 1
0
    def _extractZip(self, f, basePath=None, depth=0):
        with ZipFile(f) as zf:
            for member in zf.infolist():
                if depth > 0:
                    member.filename = os.path.join(
                        *splitPath(member.filename)[depth:])

                self._extract(zf, member, member.filename, basePath)
Ejemplo n.º 2
0
    def _extractTar(self, f, basePath=None, depth=0):
        with tarfile.open(fileobj=f) as tf:
            for member in tf.getmembers():
                if depth > 0:
                    member.name = os.path.join(
                        *splitPath(member.name)[depth:])

                self._extract(tf, member, member.name, basePath)