comparison genshi/template/directives.py @ 711:0cc3f1eabe13 experimental-match-fastpaths

revert an optimization that made a dumb assumption about when py:matches get stored..
author aflett
date Mon, 07 Apr 2008 17:15:00 +0000
parents 2a7a19861a89
children 0e8b92905741
comparison
equal deleted inserted replaced
705:2a7a19861a89 711:0cc3f1eabe13
455 return cls(value, template, frozenset(hints), namespaces, *pos[1:]), \ 455 return cls(value, template, frozenset(hints), namespaces, *pos[1:]), \
456 stream 456 stream
457 attach = classmethod(attach) 457 attach = classmethod(attach)
458 458
459 def __call__(self, stream, directives, ctxt, **vars): 459 def __call__(self, stream, directives, ctxt, **vars):
460 if ctxt._match_set is None:
461 # lazily create MatchSet so that it doesn't burden the
462 # _match filter when there are no py:matches defined.
463 ctxt._match_set = MatchSet()
464 ctxt._match_set.add((self.path.test(ignore_context=True), 460 ctxt._match_set.add((self.path.test(ignore_context=True),
465 self.path, list(stream), self.hints, 461 self.path, list(stream), self.hints,
466 self.namespaces, directives)) 462 self.namespaces, directives))
467 return [] 463 return []
468 464
Copyright (C) 2012-2017 Edgewall Software