artık symlinkleri düzgün oluşturuyoruz.. onur küçük beylere teşekkür ederik.

This commit is contained in:
A. Murat Eren
2005-06-15 14:34:28 +00:00
parent 7494390171
commit 089e803aff
+10 -7
View File
@@ -56,8 +56,7 @@ class ArchiveZip(ArchiveBase):
super(ArchiveZip, self).unpack(targetDir) super(ArchiveZip, self).unpack(targetDir)
zip = zipfile.ZipFile(self.filePath, 'r') zip = zipfile.ZipFile(self.filePath, 'r')
fileNames = zip.namelist() for file in zip.namelist():
for file in fileNames:
ofile = self.targetDir + '/' + file ofile = self.targetDir + '/' + file
# a directory is present. lets continue # a directory is present. lets continue
@@ -67,11 +66,15 @@ class ArchiveZip(ArchiveBase):
if not os.path.exists(os.path.dirname(ofile)): if not os.path.exists(os.path.dirname(ofile)):
os.mkdir(ofile) os.mkdir(ofile)
continue continue
info = zip.getinfo(file)
buff = open (ofile, 'wb') if hex(info.external_attr)[2] == 'A':
fileContent = zip.read(file) target = zip.read(file)
buff.write(fileContent) os.symlink(target, ofile)
buff.close() else:
buff = open (ofile, 'wb')
fileContent = zip.read(file)
buff.write(fileContent)
buff.close()
zip.close() zip.close()