provide additional mime types (MS Office 2007)
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@3959 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
a59f6a0e32
commit
dea27d7482
3 changed files with 18 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (c) 2008 Helmut Merz helmutm@cy55.de
|
||||
# Copyright (c) 2010 Helmut Merz helmutm@cy55.de
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -22,6 +22,7 @@ Base implementation for accessing external content objects.
|
|||
$Id$
|
||||
"""
|
||||
|
||||
import mimetypes
|
||||
import os
|
||||
from urllib import urlencode
|
||||
from zope.app.container.contained import Contained
|
||||
|
@ -210,3 +211,7 @@ class MimeTypes(dict):
|
|||
mtFile.close()
|
||||
|
||||
mimeTypes = MimeTypes()
|
||||
|
||||
|
||||
mimetypes.init(mimetypes.knownfiles +
|
||||
[os.path.join(os.path.dirname(__file__), 'mime.types')])
|
||||
|
|
|
@ -110,3 +110,12 @@ A file object has additional attributes/methods.
|
|||
>>> html.icon
|
||||
'html'
|
||||
|
||||
|
||||
MIMETypes
|
||||
=========
|
||||
|
||||
>>> import mimetypes
|
||||
>>> mimetypes.guess_type('test.xlsx')
|
||||
('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', None)
|
||||
>>> mimetypes.guess_type('test.xlsm')
|
||||
('application/vnd.ms-excel.sheet.macroEnabled.12', None)
|
||||
|
|
|
@ -217,6 +217,7 @@ application/vnd.mozilla.xul+xml xul
|
|||
application/vnd.ms-artgalry
|
||||
application/vnd.ms-asf
|
||||
application/vnd.ms-excel xls xlb xlt
|
||||
application/vnd.ms-excel.sheet.macroEnabled.12 xlsm
|
||||
application/vnd.ms-lrm
|
||||
application/vnd.ms-pki.seccat cat
|
||||
application/vnd.ms-pki.stl stl
|
||||
|
@ -249,6 +250,8 @@ application/vnd.oasis.opendocument.text odt
|
|||
application/vnd.oasis.opendocument.text-master odm
|
||||
application/vnd.oasis.opendocument.text-template ott
|
||||
application/vnd.oasis.opendocument.text-web oth
|
||||
application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
|
||||
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
|
||||
application/vnd.osa.netdeploy
|
||||
application/vnd.palm
|
||||
application/vnd.pg.format
|
||||
|
|
Loading…
Add table
Reference in a new issue