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

Method _conversion_checks

box/box.py:952–965  ·  view source on GitHub ↗

Internal use for checking if a duplicate safe attribute already exists :param item: Item to see if a dup exists

(self, item)

Source from the content-addressed store, hash-verified

950 return out
951
952 def _conversion_checks(self, item):
953 """
954 Internal use for checking if a duplicate safe attribute already exists
955
956 :param item: Item to see if a dup exists
957 """
958 safe_item = self._safe_attr(item)
959
960 if safe_item in self._box_config["__safe_keys"]:
961 dups = [f"{item}({safe_item})", f'{self._box_config["__safe_keys"][safe_item]}({safe_item})']
962 if self._box_config["box_duplicates"].startswith("warn"):
963 warnings.warn(f"Duplicate conversion attributes exist: {dups}", BoxWarning)
964 else:
965 raise BoxError(f"Duplicate conversion attributes exist: {dups}")
966
967 def to_json(
968 self,

Callers 1

__setitem__Method · 0.95

Calls 2

_safe_attrMethod · 0.95
BoxErrorClass · 0.90

Tested by

no test coverage detected