MCPcopy Create free account
hub / github.com/SpaceZephyr/myskill / _add_to_comments_extended_xml

Method _add_to_comments_extended_xml

docx/scripts/document.py:1091–1105  ·  view source on GitHub ↗

Add a single comment to commentsExtended.xml.

(self, para_id, parent_para_id)

Source from the content-addressed store, hash-verified

1089 editor.append_to(root, comment_xml)
1090
1091 def _add_to_comments_extended_xml(self, para_id, parent_para_id):
1092 """Add a single comment to commentsExtended.xml."""
1093 if not self.comments_extended_path.exists():
1094 shutil.copy(
1095 TEMPLATE_DIR / "commentsExtended.xml", self.comments_extended_path
1096 )
1097
1098 editor = self["word/commentsExtended.xml"]
1099 root = editor.get_node(tag="w15:commentsEx")
1100
1101 if parent_para_id:
1102 xml = f'<w15:commentEx w15:paraId="{para_id}" w15:paraIdParent="{parent_para_id}" w15:done="0"/>'
1103 else:
1104 xml = f'<w15:commentEx w15:paraId="{para_id}" w15:done="0"/>'
1105 editor.append_to(root, xml)
1106
1107 def _add_to_comments_ids_xml(self, para_id, durable_id):
1108 """Add a single comment to commentsIds.xml."""

Callers 2

add_commentMethod · 0.95
reply_to_commentMethod · 0.95

Calls 2

get_nodeMethod · 0.80
append_toMethod · 0.45

Tested by

no test coverage detected