Skip to content

Commit

Permalink
Rename _clean_destination in clear_destination.
Browse files Browse the repository at this point in the history
  • Loading branch information
Starou committed Feb 5, 2024
1 parent e99189f commit a047e55
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/simple_idml/idml.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,12 +456,12 @@ def _import_node(source_node, at=None, element_id=None, story=None, ignoreconten

_move_siblings_content(at, element_id)

self._clean_destination(source_node, at)
self._clear_destination(source_node, at)
self.init_lazy_references()
_import_node(source_node, at)
return self

def _clean_destination(self, source_node, at):
def _clear_destination(self, source_node, at):
""" Remove content marked for removal before importing XML. """

element_id = self.xml_structure.xpath(at)[0].get("Self")
Expand All @@ -483,14 +483,14 @@ def _clean_destination(self, source_node, at):
if destination_node_children_tags == source_node_children_tags:
for s, d in zip(source_node_children,
[self.xml_structure_tree.getpath(c) for c in destination_node_children]):
self._clean_destination(s, at=d)
self._clear_destination(s, at=d)

# Step-by-step iteration.
else:
destination_node_child = next(destination_node_children, None)
for source_child in source_node_children:
if destination_node_child is not None and source_child.tag == destination_node_child.tag:
self._clean_destination(source_child,
self._clear_destination(source_child,
at=self.xml_structure_tree.getpath(destination_node_child))
destination_node_child = next(destination_node_children, None)

Expand Down

0 comments on commit a047e55

Please sign in to comment.