Back to index

plone3  3.1.7
rcs.py
Go to the documentation of this file.
00001 from Products.CMFPlone.migrations.migration_util import loadMigrationProfile
00002 
00003 from Products.MimetypesRegistry.mime_types.mtr_mimetypes import text_web_intelligent
00004 from types import InstanceType
00005 from Products.PortalTransforms.transforms.web_intelligent_plain_text_to_html import register as intel2html_register
00006 from Products.PortalTransforms.transforms.html_to_web_intelligent_plain_text import register as html2intel_register
00007 
00008 
00009 def rc1_rc2(portal):
00010     """ 3.0-rc1 -> 3.0-rc2
00011     """
00012 
00013     out = []
00014 
00015     addIntelligentText(portal, out)
00016 
00017     return out
00018 
00019 def rc2_final(portal):
00020     
00021     out = []
00022     
00023     loadMigrationProfile(portal, 'profile-Products.CMFPlone.migrations:3.0rc2-3.0final')
00024     
00025     return out
00026 
00027 def addIntelligentText(portal, out):
00028     """ add intelligenttext mime type and transforms that have been
00029     introduced in MimetypesRegistry and PortalTransforms 1.6 and that
00030     are never updated anywhere (#6684)
00031     """
00032     # Add mime type
00033     # See MimetypesRegistry/mime_types/mtr_mimetypes.py
00034     mt = text_web_intelligent
00035     if type(mt) != InstanceType:
00036         mt = mt()
00037     portal.mimetypes_registry.register(mt)
00038     out.append("Added text_web_intelligent mime type to registry")
00039 
00040     # Add transforms
00041     # See PortalTransforms/transforms/__init__.py
00042     engine = portal.portal_transforms
00043     engine.registerTransform(intel2html_register())
00044     out.append("Added intelligenttext to html transform to registry")
00045     engine.registerTransform(html2intel_register())
00046     out.append("Added html to intelligenttext transform to registry")