def run(self,ctx,**k): want=True event = self.params(ctx) w = event[:] if w[0] == "not": want=False w = w[1:] if self.procs is None: if check_condition(ctx,*w) == want: return else: raise TrySomethingElse(*w) if check_condition(ctx,*w) == want: return super(IfStatement,self).run(ctx,**k) elif self.else_do is not None: return self.else_do.run(ctx,**k)
def run(self,ctx,**k): want = True if self.procs is None: raise SyntaxError(u"‹while ...› can only be used as a complex statement") event = self.params(ctx) w = event[:] if w[0] == "not": want=False w = w[1:] while check_condition(ctx,*w) == want: super(WhileStatement,self).run(ctx)