# HG changeset patch # User Paul Boddie # Date 1265313907 -3600 # Node ID b45920b609fd2778c42c04ee2d4791412260b7ae # Parent 3c3880a95e3897ae6521e9127091ce323329bc24 Fixed region replacement so that a lack of events to substitute causes the appropriate completion of a page. diff -r 3c3880a95e38 -r b45920b609fd EventAggregatorSupport.py --- a/EventAggregatorSupport.py Thu Feb 04 00:24:01 2010 +0100 +++ b/EventAggregatorSupport.py Thu Feb 04 21:05:07 2010 +0100 @@ -350,14 +350,6 @@ for match in definition_list_regexp.finditer(body): - # Add preceding text to the new body. - - new_body_parts.append(body[end_of_last_match:match.start()]) - - # Get the matching regions, adding the term to the new body. - - new_body_parts.append(match.group("wholeterm")) - # Permit case-insensitive list terms. term = match.group("term").lower() @@ -378,6 +370,14 @@ event_details = event.getDetails() replaced_terms = set() + # Add preceding text to the new body. + + new_body_parts.append(body[end_of_last_match:match.start()]) + + # Get the matching regions, adding the term to the new body. + + new_body_parts.append(match.group("wholeterm")) + # Special value type handling. if event_details.has_key(term): @@ -404,6 +404,8 @@ replaced_terms.add(term) + # Add the replaced value. + new_body_parts.append(desc) # Remember where in the page has been processed.