Show
Ignore:
Timestamp:
01/15/09 07:43:30 (19 months ago)
Author:
Ga?tan de Menten <ged@…>
Branch:
default
Message:

further simplification/optimization

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • relatorio/templates/opendocument.py

    r89 r90  
    265265                # - we add all the nodes between the opening and closing 
    266266                #   statements to this new node 
    267                 can_append = False 
    268                 for node in ancestor.iterchildren(): 
    269                     if node in o_ancestors: 
    270                         outermost_o_ancestor = node 
    271                         assert outermost_o_ancestor == o_ancestors[-1] 
    272                         can_append = True 
    273                         continue 
    274                     if node in c_ancestors: 
    275                         outermost_c_ancestor = node 
    276                         assert outermost_c_ancestor == c_ancestors[-1] 
     267                outermost_o_ancestor = o_ancestors[-1] 
     268                outermost_c_ancestor = c_ancestors[-1] 
     269                for node in outermost_o_ancestor.itersiblings(): 
     270                    if node is outermost_c_ancestor: 
    277271                        break 
    278                     if can_append: 
    279                         # we are between the opening and closing node 
    280                         genshi_node.append(node) 
     272                    genshi_node.append(node) 
    281273 
    282274                # - we replace the opening statement by the <py:xxx> node