Esempio n. 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()
Esempio n. 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()
Esempio n. 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
Esempio n. 4
0
 def __call__(self, value):
     ctx.curr()[self.name] = value
     return value
Esempio n. 5
0
 def __call__(self, value):
     c = ctx.curr()
     for func in self.funcs:
         if not func(c):
             raise NotMatchException(self, value)
     return value
Esempio n. 6
0
 def __call__(self, value):
     c = ctx.curr()
     for func in self.funcs:
         if not func(c):
             raise NotMatchException(self, value)
     return value
Esempio n. 7
0
 def __call__(self, value):
     ctx.curr()[self.name] = value
     return value