def update(self): self.task_progress.add('collecting', title=u'', progress=0.0) event = zope.contentprovider.interfaces.BeforeUpdateEvent total = len(self.viewlets) for nv, viewlet in enumerate(self.viewlets): title = format_message(self.collecting_title, {'name': viewlet.title or _('files')}) self.task_progress.force('collecting', title=title, progress=normalized_progress(nv, total), active=True) zope.event.notify(event(viewlet, self.request)) viewlet.update() title = format_message(self.collecting_title, {'name': _('files')}) self.task_progress.force('collecting', title=title, progress=None, active=False) self.addArchivers()
def update(self): self.task_progress.add('collecting', title=u'', progress=0.0) event = zope.contentprovider.interfaces.BeforeUpdateEvent total = len(self.viewlets) for nv, viewlet in enumerate(self.viewlets): title = format_message(self.collecting_title, {'name': viewlet.title or _('files')}) self.task_progress.force( 'collecting', title=title, progress=normalized_progress(nv, total), active=True) zope.event.notify(event(viewlet, self.request)) viewlet.update() title = format_message(self.collecting_title, {'name': _('files')}) self.task_progress.force('collecting', title=title, progress=None, active=False) self.addArchivers()
def __call__(self, *args, **kw): if not self._updated: event = zope.contentprovider.interfaces.BeforeUpdateEvent zope.event.notify(event(self, self.request)) self.update() return self.render(*args, **kw)
def update(self): event = zope.contentprovider.interfaces.BeforeUpdateEvent for viewlet in self.viewlets: zope.event.notify(event(viewlet, self.request)) viewlet.update()