Commit 8b4151e4 authored by Nicolas Delaby's avatar Nicolas Delaby

Use os.path.splitext to extract file extension


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38376 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9292eca1
......@@ -330,9 +330,11 @@ class ContributionTool(BaseTool):
property_dict['portal_type'] = (property_dict['portal_type'],)
else:
# we have to find candidates by file extenstion
if file_name.rfind('.')!= -1:
ext = file_name.split('.')[-1]
property_dict['portal_type'] = self.ContributionTool_getCandidateTypeListByExtension(ext)
basename, extension = os.path.splitext(file_name)
if extension:
extension = extension.lstrip('.') # remove first dot
property_dict['portal_type'] =\
self.ContributionTool_getCandidateTypeListByExtension(extension)
return property_dict
# WebDAV virtual folder support
......
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