Skip to content

Commit 5620f74

Browse files
committed
exc: pydocstyle manual fixes
1 parent af611f7 commit 5620f74

File tree

1 file changed

+33
-5
lines changed

1 file changed

+33
-5
lines changed

src/tmuxp/exc.py

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,13 @@ class WorkspaceError(TmuxpException):
2020

2121

2222
class SessionNotFound(TmuxpException):
23+
"""tmux session not found."""
24+
2325
def __init__(
24-
self, session_target: t.Optional[str] = None, *args: object, **kwargs: object
26+
self,
27+
session_target: t.Optional[str] = None,
28+
*args: object,
29+
**kwargs: object,
2530
) -> None:
2631
msg = "Session not found"
2732
if session_target is not None:
@@ -30,8 +35,13 @@ def __init__(
3035

3136

3237
class WindowNotFound(TmuxpException):
38+
"""tmux window not found."""
39+
3340
def __init__(
34-
self, window_target: t.Optional[str] = None, *args: object, **kwargs: object
41+
self,
42+
window_target: t.Optional[str] = None,
43+
*args: object,
44+
**kwargs: object,
3545
) -> None:
3646
msg = "Window not found"
3747
if window_target is not None:
@@ -40,8 +50,13 @@ def __init__(
4050

4151

4252
class PaneNotFound(TmuxpException):
53+
"""tmux pane not found."""
54+
4355
def __init__(
44-
self, pane_target: t.Optional[str] = None, *args: object, **kwargs: object
56+
self,
57+
pane_target: t.Optional[str] = None,
58+
*args: object,
59+
**kwargs: object,
4560
) -> None:
4661
msg = "Pane not found"
4762
if pane_target is not None:
@@ -52,11 +67,17 @@ def __init__(
5267
class EmptyWorkspaceException(WorkspaceError):
5368
"""Workspace file is empty."""
5469

55-
def __init__(self, *args: object, **kwargs: object) -> None:
70+
def __init__(
71+
self,
72+
*args: object,
73+
**kwargs: object,
74+
) -> None:
5675
return super().__init__("Session configuration is empty.", *args, **kwargs)
5776

5877

5978
class SessionMissingWorkspaceException(WorkspaceError, ObjectDoesNotExist):
79+
"""Session missing while loading tmuxp workspace."""
80+
6081
def __init__(self, *args: object, **kwargs: object) -> None:
6182
return super().__init__(
6283
"No session object exists for WorkspaceBuilder. "
@@ -67,6 +88,8 @@ def __init__(self, *args: object, **kwargs: object) -> None:
6788

6889

6990
class ActiveSessionMissingWorkspaceException(WorkspaceError):
91+
"""Active session cannot be found while loading tmuxp workspace."""
92+
7093
def __init__(self, *args: object, **kwargs: object) -> None:
7194
return super().__init__("No session active.", *args, **kwargs)
7295

@@ -76,6 +99,8 @@ class TmuxpPluginException(TmuxpException):
7699

77100

78101
class BeforeLoadScriptNotExists(OSError):
102+
"""Raises if shell script could not be found."""
103+
79104
def __init__(self, *args: object, **kwargs: object) -> None:
80105
super().__init__(*args, **kwargs)
81106

@@ -84,7 +109,9 @@ def __init__(self, *args: object, **kwargs: object) -> None:
84109

85110
@implements_to_string
86111
class BeforeLoadScriptError(Exception):
87-
"""Exception replacing :py:class:`subprocess.CalledProcessError` for
112+
"""Shell script execution error.
113+
114+
Replaces :py:class:`subprocess.CalledProcessError` for
88115
:meth:`tmuxp.util.run_before_script`.
89116
"""
90117

@@ -102,4 +129,5 @@ def __init__(
102129
)
103130

104131
def __str__(self) -> str:
132+
"""Return shell error message."""
105133
return self.message

0 commit comments

Comments
 (0)