-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from plone/mimetypes
Added code to register additional non-standard mimetypes
- Loading branch information
Showing
3 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
text/css css less |