示例#1
0
    def update(self):
        if not self.__installed__:
            raise interfaces.ProductNotInstalledError(
                _('Product is not installed.'))

        configure(self, {})
        event.notify(
            interfaces.ProductUpdatedEvent(self.__product_name__, self))
        event.notify(ObjectModifiedEvent(getSite()))

        self._checkRequiredUpdate()
示例#2
0
def _bootstrap_zodb(conn, root_name):
    root = conn.root()
    created = False
    if not root_name in root:
        root_folder = rootFolder()
        notify(zope.lifecycleevent.ObjectCreatedEvent(root_folder))
        root[root_name] = root_folder
        if not zope.component.interfaces.ISite.providedBy(root_folder):
            site_manager = site.LocalSiteManager(root_folder)
            root_folder.setSiteManager(site_manager)
        transaction.commit()
        created = True
        try:
            from z3c.configurator import configure
        except ImportError:
            pass
        else:
            logging.info('We have z3c.configurator, fire his events!')
            configure(root_folder, {})
    logging.info('Firing events...')
    notify(zope.processlifetime.DatabaseOpenedWithRoot(conn.db()))
    return created
示例#3
0
def reconfigureSite(app, *args):
    site = removeSecurityProxy(app)
    configure(site, {})
示例#4
0
def siteAdded(site, event):
    configure(site, {}, names=['_initialize',])
示例#5
0
def reconfigurePortal(app, *args):
    portal = removeSecurityProxy(app)
    configure(portal, {})