collaboration.snapshot module¶
Class representing a remote Snapshot |
|
Class representing a remote undo entry |
- class Snapshot(handle)[source]¶
Bases:
object
Class representing a remote Snapshot
- create_undo_entry(parent: Optional[int], data: str) UndoEntry [source]¶
Create a new Undo Entry in this snapshot.
- download(progress: ~typing.Callable[[int, int], bool] = <function nop>) bytes [source]¶
Download the snapshot fields blob, compatible with binaryninja.KeyValueStore.
- download_analysis_cache(progress: ~typing.Callable[[int, int], bool] = <function nop>) bytes [source]¶
Download the analysis cache fields blob, compatible with binaryninja.KeyValueStore.
- download_snapshot_file(progress: ~typing.Callable[[int, int], bool] = <function nop>) bytes [source]¶
Download the contents of the file in the Snapshot.
- finalize()[source]¶
Mark a snapshot as Finalized, committing it to the Remote, preventing future updates, and allowing snapshots to be children of it.
- Raises:
RuntimeError if there was an error
- static get_for_local_snapshot(snapshot: Snapshot) Optional[Snapshot] [source]¶
Get the remote snapshot associated with a local snapshot (if it exists)
- Parameters:
snap – Local snapshot
snapshot (Snapshot) –
- Returns:
Remote snapshot if it exists, or None if not
- Raises:
RuntimeError – If there was an error
- Return type:
- get_local_snapshot(bv: BinaryView) Optional[Snapshot] [source]¶
Get the local snapshot associated with a remote snapshot (if it exists)
- Parameters:
bv (BinaryView) – BinaryView with database to search
- Returns:
Local snapshot, if one exists. Else, None
- Raises:
RuntimeError if there was an error
- Return type:
- get_undo_entry_by_id(id: int) Optional[UndoEntry] [source]¶
Get a specific Undo Entry in the Snapshot by its id
Note
If undo entries have not been pulled, they will be pulled upon calling this.
- pull_undo_entries(progress: ~typing.Callable[[int, int], bool] = <function nop>)[source]¶
Pull the list of Undo Entries from the Remote.
- property author_username: str¶
Get the username of the author of a snapshot, if possible (vs author which is user id)
- Returns:
Snapshot author username
- property child_ids: List[str]¶
List of ids of all remote child Snapshots
- Returns:
List of id strings
- Raises:
RuntimeError if there was an error
- property children: List[Snapshot]¶
List of all child Snapshot objects
- Returns:
List of Snapshot objects
- Raises:
RuntimeError if there was an error
- property description: str¶
Get the description of a snapshot: the lines of its name after the first line
- Returns:
Snapshot description as described
- property has_pulled_undo_entires: bool¶
If the snapshot has pulled undo entries yet
- Returns:
True if they have been pulled
- property hash: str¶
Hash of snapshot data (analysis and markup, etc) No specific hash algorithm is guaranteed
- Returns:
Hash string
- property is_finalized: bool¶
If the snapshot has been finalized on the server and is no longer editable
- Returns:
True if finalized
- property last_modified: datetime¶
Date of last modification to the snapshot
- Returns:
Last modified date
- property parent_ids: List[str]¶
List of ids of all remote parent Snapshots
- Returns:
List of id strings
- Raises:
RuntimeError if there was an error
- property parents: List[Snapshot]¶
List of all parent Snapshot objects
- Returns:
List of Snapshot objects
- Raises:
RuntimeError if there was an error
- property snapshot_file_hash: str¶
Hash of file contents in snapshot No specific hash algorithm is guaranteed
- Returns:
Hash string
- property title: str¶
Get the title of a snapshot: the first line of its name
- Returns:
Snapshot title as described
- class UndoEntry(handle)[source]¶
Bases:
object
Class representing a remote undo entry
- property parent: Optional[UndoEntry]¶
Parent Undo Entry object
- Returns:
Undo Entry object, if there is one, None otherwise