Ticket #396: select_added_too_late.2.patch
| File select_added_too_late.2.patch, 1.5 KB (added by Carsten Klein <carsten.klein@…>, 13 years ago) |
|---|
-
genshi/template/markup.py
343 343 del match_templates[idx] 344 344 idx -= 1 345 345 346 # Make the select() function available in the body of the 347 # match template 348 selected = [False] 349 def select(path): 350 selected[0] = True 351 return content.select(path, namespaces, ctxt) 352 vars = dict(select=select) 353 346 354 # Let the remaining match templates know about the event so 347 355 # they get a chance to update their internal state 348 356 for test in [mt[0] for mt in match_templates[idx + 1:]]: … … 362 370 content = list(content) 363 371 content = Stream(content) 364 372 365 # Make the select() function available in the body of the366 # match template367 selected = [False]368 def select(path):369 selected[0] = True370 return content.select(path, namespaces, ctxt)371 vars = dict(select=select)372 373 373 # Recursively process the output 374 374 template = _apply_directives(template, directives, ctxt, 375 375 vars)
