Commit da4fae50 authored by Nicolas Delaby's avatar Nicolas Delaby

rename variables for better clarity.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@40492 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent eff50ae9
...@@ -69,19 +69,19 @@ class FileSystemDocument(object): ...@@ -69,19 +69,19 @@ class FileSystemDocument(object):
# If is a zipfile is need extract all files from whitin the compressed file # If is a zipfile is need extract all files from whitin the compressed file
if is_zipfile(file_path): if is_zipfile(file_path):
zipfile = ZipFile(file_path) zipfile = ZipFile(file_path)
if 'mimetype' not in zipfile.namelist() and \ zip_filename_list = zipfile.namelist()
'[Content_Types].xml' not in zipfile.namelist(): if 'mimetype' not in zip_filename_list and \
'[Content_Types].xml' not in zip_filename_list:
zipfile.extractall(path=self.directory_name) zipfile.extractall(path=self.directory_name)
zipfile.close() zipfile.close()
remove(file_path) filename_list = listdir(self.directory_name)
file_list = listdir(self.directory_name)
if 'index.html' in file_list: if 'index.html' in file_list:
file_path = join(self.directory_name, 'index.html') file_path = join(self.directory_name, 'index.html')
else: else:
extension_list = ['text/html', 'application/xhtml+xml'] mimetype_list = ['text/html', 'application/xhtml+xml']
for file in file_list: for filename in filename_list:
if mimetypes.guess_type(file)[0] in extension_list: if mimetypes.guess_type(filename)[0] in mimetype_list:
file_path = join(self.directory_name, file) file_path = join(self.directory_name, filename)
break break
return file_path return file_path
......
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