def uninstall(portal, reinstall=False): """Run the GS profile to install this package""" out = StringIO() if not reinstall: runProfile(portal, 'profile-collective.lineage:uninstall') _unregisterUtility(portal) remove_marker_ifaces(portal, (IChildSite, ISubtyped)) print >> out, "Uninstalled collective.lineage" return out.getvalue()
def unsetup_portal(portal, reinstall=False, reindex=True): if reinstall: # Do nothing. return if reindex: # Setting marker interfaces doesn't reindex objects, so we need to # reindex object_provides to make sure it's up to date. If called # from other products that already have done this pass reindex=False. portal.portal_catalog.manage_reindexIndex(('object_provides', )) # Then we can use the removal utility to unregister all of them: count = utils.remove_marker_ifaces(portal, interfaces.ISubtyped) logger.warn('Removed ISubtyped interface from %i objects for ' 'cleanup' % count) sm = portal.getSiteManager() if sm.adapters.lookup((Interface, Interface), IContentMenuItem, u'subtypes') is not None: sm.unregisterAdapter(None, (Interface, Interface), IContentMenuItem, u'subtypes')
def unsetup_portal(portal): count = utils.remove_marker_ifaces(portal, interfaces.ICalendarEnhanced) logger.warn('Removed ICalendarEnhanced interface from %i objects for ' 'cleanup' % count)
def unsetup_portal(portal): count = utils.remove_marker_ifaces(portal, \ [interfaces.IAudioEnhanced, interfaces.IAudioContainerEnhanced]) logger.warn('Removed IAudioEnhanced and IAudioContainerEnhanced ' 'interfaces from %i objects for cleanup' % count)