MCPcopy Create free account
hub / github.com/cdgriffith/Box / get_comment

Method get_comment

box/box.py:921–927  ·  view source on GitHub ↗

Return the comments of `key` as ``{"before": text, "eol": text}`` (a position without a comment is left out), or None. ``key=None`` returns the document comments ``{"start": ..., "end": ...}``. With box_dots, `key` can be a dotted path.

(self, key: Any = None)

Source from the content-addressed store, hash-verified

919 # ---- Comments (#184): kept outside the data, written by to_yaml with ruamel.yaml ----
920
921 def get_comment(self, key: Any = None) -> dict | None:
922 """
923 Return the comments of `key` as ``{"before": text, "eol": text}`` (a position without a comment
924 is left out), or None. ``key=None`` returns the document comments ``{"start": ..., "end": ...}``.
925 With box_dots, `key` can be a dotted path.
926 """
927 return _comments.get_comment(self, key)
928
929 def set_comment(self, key: Any, text: Any, position: str | None = None) -> None:
930 """

Calls

no outgoing calls