Пример #1
0
 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()
Пример #2
0
 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()
Пример #3
0
 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
Пример #4
0
 def __call__(self, value):
     ctx.curr()[self.name] = value
     return value
Пример #5
0
 def __call__(self, value):
     c = ctx.curr()
     for func in self.funcs:
         if not func(c):
             raise NotMatchException(self, value)
     return value
Пример #6
0
 def __call__(self, value):
     c = ctx.curr()
     for func in self.funcs:
         if not func(c):
             raise NotMatchException(self, value)
     return value
Пример #7
0
 def __call__(self, value):
     ctx.curr()[self.name] = value
     return value