Edgewall Software

Ticket #190: match_unbuffered.diff

File match_unbuffered.diff, 1.4 kB (added by cmlenz, 7 months ago)

Unbuffered match templates

  • genshi/template/markup.py

     
    275275                    if 'match_once' not in hints \ 
    276276                            and 'not_recursive' not in hints: 
    277277                        inner = self._match(inner, ctxt, [match_templates[idx]]) 
    278                     content = list(self._include(chain([event], inner, tail), 
    279                                                  ctxt)) 
     278                    content = self._include(chain([event], inner, tail), ctxt) 
     279                    if 'not_buffered' not in hints: 
     280                        content = list(content) 
    280281 
    281282                    for test in [mt[0] for mt in match_templates]: 
    282283                        test(tail[0], namespaces, ctxt, updateonly=True) 
  • genshi/template/directives.py

     
    440440    def attach(cls, template, stream, value, namespaces, pos): 
    441441        hints = [] 
    442442        if type(value) is dict: 
     443            if value.get('buffer', '').lower() == 'false': 
     444                hints.append('not_buffered') 
    443445            if value.get('once', '').lower() == 'true': 
    444446                hints.append('match_once') 
    445447            if value.get('recursive', '').lower() == 'false':