def step(self): """See base_task.""" item_stack_singleton.push(self._item.name, u'coroutines_step') retval = base_task.step(self) item_stack_singleton.pop() return retval
def run(self, name): """ desc: Executes the run phase of an item, and updates the item stack. arguments: name: desc: An item name. type: str """ item_stack_singleton.push(name, u'run') self[name].run() item_stack_singleton.pop()
def prepare(self, name): """ desc: Executes the prepare phase of an item, and updates the item stack. arguments: name: desc: An item name. type: str """ item_stack_singleton.push(name, u'prepare') self[name].prepare() item_stack_singleton.pop()
def launch(self): """See base_task.""" item_stack_singleton.push(self._item.name, u'coroutines_prepare') self._item.prepare() item_stack_singleton.pop() # New-style coroutines take a coroutines keyword, which is used to # communicate the coroutines item. Old-style coroutines do not. try: self.coroutine = self._item.coroutine(coroutines=self.coroutines) except TypeError: self.coroutine = self._item.coroutine() self.coroutines.event('launch %s' % self._item) item_stack_singleton.push(self._item.name, u'coroutines_launch') self.coroutine.send(None) item_stack_singleton.pop()
def prepare(self, name): """ desc: Executes the prepare phase of an item, and updates the item stack. arguments: name: desc: An item name. type: str example: | items.prepare('target_sketchpad') items.run('target_sketchpad') """ item_stack_singleton.push(name, u'prepare') self[name].prepare() item_stack_singleton.pop()