示例#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
文件: pattern.py 项目: ZoomQuiet/solo
 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
文件: tpl.py 项目: ZoomQuiet/solo
 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
文件: pattern.py 项目: ZoomQuiet/solo
 def __call__(self, value):
     c = ctx.curr()
     for func in self.funcs:
         if not func(c):
             raise NotMatchException(self, value)
     return value
示例#7
0
文件: pattern.py 项目: ZoomQuiet/solo
 def __call__(self, value):
     ctx.curr()[self.name] = value
     return value