def handle_teasers(self, items, context): yield '<div class="teasers">' while True: yield self.renderer.render_plugin_in_context(items.popleft(), context) if not items or not matches(items[0], plugins=(Teaser,)): break yield "</div>"
def handle_faq(self, items, context): yield '<div class="faq">' while True: yield self.renderer.render_plugin_in_context( items.popleft(), context) if not items or not matches( items[0], plugins=(FAQ, File), subregions={None, "faq"}): break yield "</div>"
def handle_restart(self, items, context): first = True yield '<div class="stuff">' while True: yield self.renderer.render_plugin_in_context( items.popleft(), context) # Item isn't the first and explicitly specifies # subregion="restart", restart subregion if (not first and items and matches( items[0], subregions={None, "restart"})): break first = False yield "</div>"