MCPcopy
hub / github.com/beetbox/beets / _open

Method _open

beets/importer/state.py:87–99  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

85 self._save()
86
87 def _open(self) -> None:
88 try:
89 with open(self.path, "rb") as f:
90 state = pickle.load(f)
91 # Read the states
92 self.tagprogress = state.get("tagprogress", {})
93 self.taghistory = state.get("taghistory", set())
94 except Exception as exc:
95 # The `pickle` module can emit all sorts of exceptions during
96 # unpickling, including ImportError. We use a catch-all
97 # exception to avoid enumerating them all (the docs don't even have a
98 # full list!).
99 log.debug("state file could not be read: {}", exc)
100
101 def _save(self) -> None:
102 try:

Callers 1

__init__Method · 0.95

Calls 3

loadMethod · 0.45
getMethod · 0.45
debugMethod · 0.45

Tested by

no test coverage detected