-
Notifications
You must be signed in to change notification settings - Fork 110
Removed (should make this after frozen dataclasses) #585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
+814
−0
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Reviewer's Guide by SourceryThis pull request introduces snapshot functionality for libtmux, allowing users to create read-only copies of tmux server, session, window, and pane objects. It includes features for filtering snapshots and converting them to dictionaries for serialization. A test script is also included to demonstrate the functionality. Class diagram for ServerSnapshotclassDiagram
class ServerSnapshot {
-created_at: datetime
-sessions_snapshot: list[SessionSnapshot]
-windows_snapshot: list[WindowSnapshot]
-panes_snapshot: list[PaneSnapshot]
-server: Server
+__post_init__()
+__setattr__(name: str, value: t.Any)
+__enter__()
+__exit__(exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None)
+cmd(*args: t.Any, **kwargs: t.Any)
+is_alive() : bool
+raise_if_dead() : t.NoReturn
+sessions : QueryList[SessionSnapshot]
+windows : QueryList[WindowSnapshot]
+panes : QueryList[PaneSnapshot]
+from_server(server: Server, include_content: bool = True) : ServerSnapshot
}
ServerSnapshot -- SessionSnapshot : contains
Server <|-- ServerSnapshot
Class diagram for SessionSnapshotclassDiagram
class SessionSnapshot {
-created_at: datetime
-server_snapshot: ServerSnapshot | None
-windows_snapshot: list[WindowSnapshot]
-session: Session
+__post_init__()
+__setattr__(name: str, value: t.Any)
+__enter__()
+__exit__(exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None)
+cmd(*args: t.Any, **kwargs: t.Any)
+windows : QueryList[WindowSnapshot]
+server : ServerSnapshot | None
+active_window : WindowSnapshot | None
+active_pane : PaneSnapshot | None
+from_session(session: Session, capture_content: bool = False, server_snapshot: ServerSnapshot | None) : SessionSnapshot
}
SessionSnapshot -- WindowSnapshot : contains
Session <|-- SessionSnapshot
Class diagram for WindowSnapshotclassDiagram
class WindowSnapshot {
-created_at: datetime
-session_snapshot: SessionSnapshot | None
-panes_snapshot: list[PaneSnapshot]
-window: Window
+__post_init__()
+__setattr__(name: str, value: t.Any)
+__enter__()
+__exit__(exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None)
+cmd(*args: t.Any, **kwargs: t.Any)
+panes : QueryList[PaneSnapshot]
+session : SessionSnapshot | None
+active_pane : PaneSnapshot | None
+from_window(window: Window, capture_content: bool = True, session_snapshot: SessionSnapshot | None) : WindowSnapshot
}
WindowSnapshot -- PaneSnapshot : contains
Window <|-- WindowSnapshot
Class diagram for PaneSnapshotclassDiagram
class PaneSnapshot {
-pane_content: list[str] | None
-created_at: datetime
-window_snapshot: WindowSnapshot | None
-pane: Pane
+__post_init__()
+__setattr__(name: str, value: t.Any)
+__enter__()
+__exit__(exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None)
+cmd(*args: t.Any, **kwargs: t.Any)
+capture_pane(*args: t.Any, **kwargs: t.Any) : list[str]
+window : WindowSnapshot | None
+session : SessionSnapshot | None
+from_pane(pane: Pane, capture_content: bool = True, window_snapshot: WindowSnapshot | None) : PaneSnapshot
}
Pane <|-- PaneSnapshot
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
Introduces snapshot functionality for tmux objects, allowing read-only copies of the server, sessions, windows, and panes. These snapshots preserve the object structure and relationships while preventing modifications or tmux command execution. Also adds functionality to filter snapshots and convert them to dictionaries.
New Features: