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

Method _add_to_comments_ids_xml

docx/scripts/document.py:1107–1116  ·  view source on GitHub ↗

Add a single comment to commentsIds.xml.

(self, para_id, durable_id)

Source from the content-addressed store, hash-verified

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."""
1109 if not self.comments_ids_path.exists():
1110 shutil.copy(TEMPLATE_DIR / "commentsIds.xml", self.comments_ids_path)
1111
1112 editor = self["word/commentsIds.xml"]
1113 root = editor.get_node(tag="w16cid:commentsIds")
1114
1115 xml = f'<w16cid:commentId w16cid:paraId="{para_id}" w16cid:durableId="{durable_id}"/>'
1116 editor.append_to(root, xml)
1117
1118 def _add_to_comments_extensible_xml(self, durable_id):
1119 """Add a single comment to commentsExtensible.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