Back to index

plone3  3.1.7
two52_two53.py
Go to the documentation of this file.
00001 from Products.CMFCore.utils import getToolByName
00002 
00003 
00004 def two52_two53(portal):
00005     """2.5.2 -> 2.5.3
00006     """
00007     out = []
00008     addMissingMimeTypes(portal, out)
00009 
00010     return out
00011 
00012 
00013 def addMissingMimeTypes(portal, out):
00014     """ add mime types that weren't included with the MimetypesRegistry that
00015         shipped with Plone 2.5.2 and are now required (#6695)
00016     """
00017     # manage_addMimeType handles existing types gracefully, so we can just go
00018     # ahead and add them without testing for existing ones
00019     portal.mimetypes_registry.manage_addMimeType('text/x-web-markdown', \
00020         ['text/x-web-markdown'], ['markdown'], 'text.png')
00021     portal.mimetypes_registry.manage_addMimeType('text/x-web-textile', \
00022         ['text/x-web-textile'], ['textile'], 'text.png')
00023     out.append("Added `text/x-web-markdown` and `text/x-web-textile`.")