Changeset 2595 in products


Ignore:
Timestamp:
Jun 30, 2010 10:07:32 AM (9 years ago)
Author:
liebster
Message:

Add uninstall configlet

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/setuphandlers.py

    r2408 r2595  
    22from zope.component import getSiteManager 
    33from zope.component import getGlobalSiteManager 
     4from Products.CMFCore.utils import getToolByName 
    45from quintagroup.plonegooglesitemaps.content.newsextender import NewsExtender 
    56 
     
    2930    logger.info("Unregistered news schema extender adapters for: %s" % unregistered) 
    3031 
     32def removeConfiglet(site): 
     33    """ Remove configlet. 
     34    """ 
     35    conf_id = 'GoogleSitemaps' 
     36    controlpanel_tool = getToolByName(site, 'portal_controlpanel') 
     37    if controlpanel_tool: 
     38        controlpanel_tool.unregisterConfiglet(conf_id) 
     39        logger.log(logging.INFO, "Unregistered \"%s\" configlet." % conf_id) 
     40 
    3141 
    3242def uninstall(context): 
     
    3747    site = context.getSite() 
    3848    unregisterSchemaExtenderAdapters(site) 
     49    removeConfiglet(site) 
Note: See TracChangeset for help on using the changeset viewer.