Changeset 1515 in products


Ignore:
Timestamp:
Jan 4, 2010 6:55:19 PM (14 years ago)
Author:
liebster
Message:

Change uninstall methods

Location:
quintagroup.seoptimizer/trunk/quintagroup/seoptimizer
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/profiles/uninstall/import_steps.xml

    r424 r1515  
    22<import-steps> 
    33 <import-step id="seo_uninstall" version="20081125-01" 
    4               handler="quintagroup.seoptimizer.util.uninstall" 
     4              handler="quintagroup.seoptimizer.setuphandlers.uninstall" 
    55              title="SEO uninstallation"> 
    66  SEO uninstallation 
  • quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/util.py

    r1509 r1515  
    11from Globals import InitializeClass 
    22from AccessControl import ClassSecurityInfo 
    3 from Products.CMFCore.utils import getToolByName 
    43 
    54def createMultiColumnList(self,slist, numCols, sort_on='title_or_id'): 
     
    4746except: 
    4847    pass 
    49  
    50 def removeSkin(self, layer): 
    51     """ Remove layers. 
    52     """ 
    53     skinstool = getToolByName(self, 'portal_skins') 
    54     for skinName in skinstool.getSkinSelections(): 
    55         original_path = skinstool.getSkinPath(skinName) 
    56         original_path = [l.strip() for l in original_path.split(',')] 
    57         new_path= [] 
    58         for l in original_path: 
    59             if (l == layer) or (l.startswith(layer+'/')): 
    60                 continue 
    61             new_path.append(l) 
    62         skinstool.addSkinSelection(skinName, ','.join(new_path)) 
    63  
    64 def removeActions(self): 
    65     """ Remove actions. 
    66     """ 
    67     tool = getToolByName(self, 'portal_types') 
    68     for ptype in tool.objectValues(): 
    69         if ptype.getId() in ['File','Document','News Item']: 
    70             acts = filter(lambda x: x.id == 'seo_properties', ptype.listActions()) 
    71             action = acts and acts[0] or None 
    72             if action != None: 
    73                 acts = list(ptype.listActions()) 
    74                 ptype.deleteActions([acts.index(a) for a in acts if a.getId()=='seo_properties']) 
    75  
    76 def remove_configlets( context, conf_ids ): 
    77     """ Remove configlets. 
    78     """ 
    79     configTool = getToolByName(context, 'portal_controlpanel', None) 
    80     if configTool: 
    81         for id in conf_ids: 
    82             configTool.unregisterConfiglet(id) 
    83  
    84 def uninstall( context ): 
    85     """ Do customized uninstallation. 
    86     """ 
    87     if context.readDataFile('seo_uninstall.txt') is None: 
    88         return 
    89     site = context.getSite() 
    90     removeSkin( site, 'quintagroup.seoptimizer' ) 
    91     removeActions( site ) 
    92     remove_configlets( site, ('quintagroup.seoptimizer',)) 
    93  
Note: See TracChangeset for help on using the changeset viewer.