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

Method get_snapshot_by_id

python/collaboration/file.py:317–333  ·  view source on GitHub ↗

Get a specific Snapshot in the File by its id .. note:: If snapshots have not been pulled, they will be pulled upon calling this. :param id: Id of Snapshot :return: Snapshot object, if one with that id exists. Else, None :raises: RuntimeError if there was an error pulling snapshots

(self, id: str)

Source from the content-addressed store, hash-verified

315 return result
316
317 def get_snapshot_by_id(self, id: str) -> Optional['snapshot.CollabSnapshot']:
318 """
319 Get a specific Snapshot in the File by its id
320
321 .. note:: If snapshots have not been pulled, they will be pulled upon calling this.
322
323 :param id: Id of Snapshot
324 :return: Snapshot object, if one with that id exists. Else, None
325 :raises: RuntimeError if there was an error pulling snapshots
326 """
327 if not self.has_pulled_snapshots:
328 self.pull_snapshots()
329
330 value = core.BNRemoteFileGetSnapshotById(self._handle, id)
331 if value is None:
332 return None
333 return snapshot.CollabSnapshot(value)
334
335 def pull_snapshots(self, progress: 'util.ProgressFuncType' = util.nop):
336 """

Callers

nothing calls this directly

Calls 2

pull_snapshotsMethod · 0.95
CollabSnapshotMethod · 0.80

Tested by

no test coverage detected