Skip to content
Snippets Groups Projects
Commit 6e261bd7 authored by Alessandro Cerioni's avatar Alessandro Cerioni
Browse files

Added rules in fix_links for translating the content types associated to XLS and ODS files.

parent 9009fbba
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,8 @@ from .my_logging import logging ...@@ -8,6 +8,8 @@ from .my_logging import logging
def translate_content_type( content_type ): def translate_content_type( content_type ):
output = content_type
# TODO: complete the following list! # TODO: complete the following list!
types = ['pdf', 'html', 'zip', 'xml', 'javascript', 'json', 'csv'] types = ['pdf', 'html', 'zip', 'xml', 'javascript', 'json', 'csv']
...@@ -15,8 +17,12 @@ def translate_content_type( content_type ): ...@@ -15,8 +17,12 @@ def translate_content_type( content_type ):
if the_type in content_type: if the_type in content_type:
output = the_type.upper() output = the_type.upper()
break break
else:
output = content_type if content_type == 'application/vnd.oasis.opendocument.spreadsheet':
output = 'ODS'
if content_type == 'application/vnd.ms-excel':
output = 'XLS'
return output return output
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment