def menu(self): if self._menu is None: for stream in self.stream: if stream['stream kind'] == 'menu' and 'content' in stream: self._menu_track = stream self._menu = Menu.from_node(self.env, stream['content']) if self._menu is None: self._menu = Menu(self.env) return self._menu
def explode(self, task): for pivot in task.transform.pivot.values(): for stream in pivot.stream: if stream['enabled'] and stream['stream kind'] == 'menu': stream['enabled'] = False product = task.produce(stream) if product: if self.env.check_path_available(product.path, task.ontology['overwrite']): if not task.ontology['debug']: product.menu = Menu.from_node(self.env, stream['content']) product.write(product.path) # push a task for transcoding if 'tasks' in stream: for template in stream['tasks']: o = task.job.ontology.project('ns.system.task') for i in template: o[i] = template[i] t = queue.ResourceTask(task.job, o, product.path) t.group = task.key t.constrain({'scope':'task', 'reference':task.key, 'status':'completed'}) task.job.push(t)