def __call__(self, value): m = self.regex.match(value) if m is None: raise NotMatchException(self, value) c = ctx.curr() if c is not None: for key, value in m.groupdict().iteritems(): c[key] = value return m.groups()
def compile(src): c = ctx.curr() if c is not None: asop = c.get('conf/asop', _Template.asop) else: asop = _Template.asop try: return asop(src) except BaseException, e: pass
def __call__(self, value): ctx.curr()[self.name] = value return value
def __call__(self, value): c = ctx.curr() for func in self.funcs: if not func(c): raise NotMatchException(self, value) return value