Ejemplo n.º 1
0
def cleanupRegistry(site):
    registry = queryUtility(IRegistry)
    iprefix = IDropDownMenuSettings.__identifier__ + '.'
    delrecs = [r for r in registry.records.keys() if r.startswith(iprefix)]
    map(registry.records.__delitem__, delrecs)
    logger.log(logging.INFO,
               "Removed %s items from plone.app.registry" % delrecs)
Ejemplo n.º 2
0
def removeConfiglet(site):
    """ Remove configlet.
    """
    conf_id = "dropdownmenu"
    controlpanel_tool = getToolByName(site, 'portal_controlpanel')
    if controlpanel_tool:
        controlpanel_tool.unregisterConfiglet(conf_id)
        logger.log(logging.INFO, "Unregistered \"%s\" configlet." % conf_id)