Skip to content

Commit

Permalink
Added code to register additional non-standard mimetypes
Browse files Browse the repository at this point in the history
  • Loading branch information
obct537 committed Jul 31, 2015
1 parent 77ea3d4 commit 9a33a29
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions plone/resourceeditor/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import os.path
import mimetypes

# Borrowed from zope.contenttype.
# This allows us to register mimetypes that
# aren't included in python by default
#
# To add additional mimetypes, include a line in mime.types


def add_files(filenames):
if mimetypes.inited:
mimetypes.init(filenames)
else:
mimetypes.knownfiles.extend(filenames)


here = os.path.dirname(os.path.abspath(__file__))
add_files([os.path.join(here, "mime.types")])
1 change: 1 addition & 0 deletions plone/resourceeditor/mime.types
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
text/css css less

0 comments on commit 9a33a29

Please sign in to comment.