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 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)
def run(self, ctx, **k): want = True if self.procs is None: raise SyntaxError("‹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)
def __call__(self, *a): if len(a) == 1: a = a[0].split(' ') return check_condition(self.env, self.name + tuple(a))
def __call__(self,*a): if len(a)==1: a = a[0].split(' ') return check_condition(self.env, self.name+tuple(a))