MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / snapshots

Method snapshots

python/collaboration/file.py:296–315  ·  view source on GitHub ↗

Get the list of snapshots in this file. .. note:: If snapshots have not been pulled, they will be pulled upon calling this. :return: List of Snapshot objects :raises: RuntimeError if there was an error pulling snapshots

(self)

Source from the content-addressed store, hash-verified

294
295 @property
296 def snapshots(self) -> List['snapshot.CollabSnapshot']:
297 """
298 Get the list of snapshots in this file.
299
300 .. note:: If snapshots have not been pulled, they will be pulled upon calling this.
301
302 :return: List of Snapshot objects
303 :raises: RuntimeError if there was an error pulling snapshots
304 """
305 if not self.has_pulled_snapshots:
306 self.pull_snapshots()
307
308 count = ctypes.c_size_t()
309 value = core.BNRemoteFileGetSnapshots(self._handle, count)
310 if value is None:
311 raise RuntimeError(util._last_error())
312 result = []
313 for i in range(count.value):
314 result.append(snapshot.CollabSnapshot(value[i]))
315 return result
316
317 def get_snapshot_by_id(self, id: str) -> Optional['snapshot.CollabSnapshot']:
318 """

Callers

nothing calls this directly

Calls 3

pull_snapshotsMethod · 0.95
CollabSnapshotMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected