]> git.parisson.com Git - telemeta.git/commitdiff
Add various annotation mime types
authorGuillaume Pellerin <yomguy@parisson.com>
Tue, 10 Feb 2015 13:18:09 +0000 (14:18 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Tue, 10 Feb 2015 13:18:09 +0000 (14:18 +0100)
telemeta/models/core.py

index 9767aa56d17f84663afd6df8bf813ae3ab2ee532..e20b754a02110f7bc9b315ef9cb7ed51634e16ef 100644 (file)
@@ -63,16 +63,22 @@ from xml.dom.minidom import getDOMImplementation
 PUBLIC_ACCESS_CHOICES = (('none', _('none')), ('metadata', _('metadata')),
                          ('mixed', _('mixed')), ('full', _('full')))
 
-mimetypes.add_type('video/webm','.webm')
-mimetypes.add_type("text/xml", ".eaf")
+extra_types = {
+    '.webm': 'video/webm',
+    '.eaf': 'text/xml',  # ELAN Annotation Format
+    '.trs':  'text/xml', # Trancriber Annotation Format
+    '.svl':  'text/xml',  # Sonic Visualiser layer file
+    '.TextGrid': 'text/praat-textgrid',  # Praat TextGrid annotation file
+}
+
+for ext,mime_type in extra_types.items():
+    mimetypes.add_type(mime_type, ext)
 
 app_name = 'telemeta'
 
 strict_code = getattr(settings, 'TELEMETA_STRICT_CODE', False)
 
 
-
-
 class EnhancedQuerySet(models.query.QuerySet):
     """QuerySet with added functionalities such as WeakForeignKey handling"""