ar$iv.peye = fix_tirnak_muhabbeti(ar$iv.peye)
:( umarim bunun icin beni sopalamazsiniz.
This commit is contained in:
+4
-4
@@ -19,8 +19,8 @@ class ArchiveTarFile(ArchiveBase):
|
|||||||
super(ArchiveTarFile, self).__init__(fileName, type)
|
super(ArchiveTarFile, self).__init__(fileName, type)
|
||||||
|
|
||||||
def unpack(self):
|
def unpack(self):
|
||||||
if self.type == "targz":
|
if self.type == 'targz':
|
||||||
tar = tarfile.open(config.archives_dir() + "/" + self.fileName, 'r:gz')
|
tar = tarfile.open(config.archives_dir() + '/' + self.fileName, 'r:gz')
|
||||||
for tarinfo in tar:
|
for tarinfo in tar:
|
||||||
tar.extract(tarinfo)
|
tar.extract(tarinfo)
|
||||||
tar.close()
|
tar.close()
|
||||||
@@ -31,14 +31,14 @@ class ArchiveZip(ArchiveBase):
|
|||||||
super(ArchiveZip, self).__init__(fileName, type)
|
super(ArchiveZip, self).__init__(fileName, type)
|
||||||
|
|
||||||
def unpack(self):
|
def unpack(self):
|
||||||
zip = zipfile.Zipfile(config.archives_dir() + "/" + self.fileName, 'r')
|
zip = zipfile.Zipfile(config.archives_dir() + '/' + self.fileName, 'r')
|
||||||
fileNames = zip.namelist()
|
fileNames = zip.namelist()
|
||||||
for file in fileNames:
|
for file in fileNames:
|
||||||
file = config.archives_dir() + '/' + file
|
file = config.archives_dir() + '/' + file
|
||||||
if not os.path.exists(os.path.dirname(file)):
|
if not os.path.exists(os.path.dirname(file)):
|
||||||
os.mkdir(os.path.dirname(file))
|
os.mkdir(os.path.dirname(file))
|
||||||
continue
|
continue
|
||||||
buff = open (file, "wb")
|
buff = open (file, 'wb')
|
||||||
fileContent = zip.read(file)
|
fileContent = zip.read(file)
|
||||||
buff.write(fileContent)
|
buff.write(fileContent)
|
||||||
buff.close()
|
buff.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user