MCPcopy Create free account
hub / github.com/python-cmd2/cmd2 / to_dict

Method to_dict

cmd2/history.py:118–120  ·  view source on GitHub ↗

Convert this HistoryItem into a dictionary for use in persistent JSON history files.

(self)

Source from the content-addressed store, hash-verified

116 return ret_str
117
118 def to_dict(self) -> dict[str, Any]:
119 """Convert this HistoryItem into a dictionary for use in persistent JSON history files."""
120 return {HistoryItem._statement_field: self.statement.to_dict()}
121
122 @staticmethod
123 def from_dict(source_dict: dict[str, Any]) -> "HistoryItem":

Callers 1

to_jsonMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected