Commit 7b4f7e77 authored by Administrator's avatar Administrator

[BUGFIX] Zip from Mac add folders inside it...

parent df11d260
...@@ -102,10 +102,16 @@ class FileParser: ...@@ -102,10 +102,16 @@ class FileParser:
if zipfile.is_zipfile(file): if zipfile.is_zipfile(file):
zipArchive = zipfile.ZipFile(file) zipArchive = zipfile.ZipFile(file)
for filename in zipArchive.namelist(): for filename in zipArchive.namelist():
metadata_list += self.parse(zipArchive.open(filename, "r")) try:
metadata_list += self.parse(zipArchive.open(filename, "r"))
except Exception as error:
print(error)
# ...otherwise, let's parse it directly! # ...otherwise, let's parse it directly!
else: else:
metadata_list += self._parse(file) try:
metadata_list += self._parse(file)
except Exception as error:
print(error)
# return the list of formatted metadata # return the list of formatted metadata
return map(self.format_metadata, metadata_list) return map(self.format_metadata, metadata_list)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment