comparison markup/template.py @ 199:71ce4b5335ba trunk

* Removed storage of substream in `MatchDirective`, because it's already being stored in the match templates (related to #39). * Updated changelog.
author cmlenz
date Fri, 25 Aug 2006 10:08:46 +0000
parents 404c02f3156b
children 92353f28ae54
comparison
equal deleted inserted replaced
198:ca8a9defe6fe 199:71ce4b5335ba
442 <span> 442 <span>
443 Hello Dude 443 Hello Dude
444 </span> 444 </span>
445 </div> 445 </div>
446 """ 446 """
447 __slots__ = ['path', 'stream'] 447 __slots__ = ['path']
448 448
449 ATTRIBUTE = 'path' 449 ATTRIBUTE = 'path'
450 450
451 def __init__(self, value, filename=None, lineno=-1, offset=-1): 451 def __init__(self, value, filename=None, lineno=-1, offset=-1):
452 Directive.__init__(self, None, filename, lineno, offset) 452 Directive.__init__(self, None, filename, lineno, offset)
453 self.path = Path(value, filename, lineno) 453 self.path = Path(value, filename, lineno)
454 self.stream = [] 454
455 455 def __call__(self, stream, ctxt, directives):
456 def __call__(self, stream, ctxt, directives):
457 self.stream = list(stream)
458 ctxt._match_templates.append((self.path.test(ignore_context=True), 456 ctxt._match_templates.append((self.path.test(ignore_context=True),
459 self.path, self.stream, directives)) 457 self.path, list(stream), directives))
460 return [] 458 return []
461 459
462 def __repr__(self): 460 def __repr__(self):
463 return '<%s "%s">' % (self.__class__.__name__, self.path.source) 461 return '<%s "%s">' % (self.__class__.__name__, self.path.source)
464 462
Copyright (C) 2012-2017 Edgewall Software