Back to index

plone3  3.1.7
Functions
Upgrade Namespace Reference

Functions

def upgrade_decor_skins

Function Documentation

    Upgrade old skin diretories loaded from 'CMFDecor' to load from
    'CMFDefault' (and zap the 'zpt_images' one).

Definition at line 20 of file Upgrade.py.

00020 
00021 def upgrade_decor_skins( self ):
00022     """
00023         Upgrade old skin diretories loaded from 'CMFDecor' to load from
00024         'CMFDefault' (and zap the 'zpt_images' one).
00025     """
00026     log = []
00027 
00028     DELETED_SKINS = ( 'zpt_images' , )
00029 
00030     MOVED_SKINS = ( 'zpt_content'
00031                   , 'zpt_control'
00032                   , 'zpt_generic'
00033                   )
00034 
00035     skins_tool = aq_inner( self ).portal_skins # start from CMFSite!
00036 
00037     for deleted in DELETED_SKINS:
00038 
00039         try:
00040 
00041             skins_tool._delObject( deleted )
00042 
00043         except AttributeError:
00044             pass
00045 
00046         else:
00047             log.append( 'Deleted CMFDecor skin directory: %s' % deleted )
00048 
00049     for moved in MOVED_SKINS:
00050 
00051         skin_dir = getattr( skins_tool, moved, None )
00052 
00053         if skin_dir is not None:
00054 
00055             skin_dir.manage_properties(
00056                 dirpath='Products/CMFDefault/skins/%s' % moved )
00057             log.append( 'Updated CMFDecor skin directory to CMFDefault: %s'
00058                       % moved )
00059 
00060     return '\n'.join(log)