Skip to content

Commit

Permalink
Merge pull request #8 from plone/mimetypes
Browse files Browse the repository at this point in the history
Added code to register additional non-standard mimetypes
  • Loading branch information
vangheem committed Jul 31, 2015
2 parents 77ea3d4 + 94ff5af commit 5301070
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Changelog
- Fixed issue with ascii encoding [obct537]
- now properly serves filesystem files to the thememapper
[obct537]
- resourceeditor will now register non-standard mimetypes
in the python mimetype module [obct537]

2.0.0 (2015-03-21)
------------------
Expand Down
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 5301070

Please sign in to comment.