Skip to content

Commit f109a54

Browse files
committed
cli(import_config): Note pydocstyle updates
1 parent acb1c6a commit f109a54

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

src/tmuxp/cli/import_config.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""CLI for ``tmuxp shell`` subcommand."""
12
import argparse
23
import os
34
import pathlib
@@ -12,8 +13,7 @@
1213

1314

1415
def get_tmuxinator_dir() -> pathlib.Path:
15-
"""
16-
Return tmuxinator configuration directory.
16+
"""Return tmuxinator configuration directory.
1717
1818
Checks for ``TMUXINATOR_CONFIG`` environmental variable.
1919
@@ -33,8 +33,7 @@ def get_tmuxinator_dir() -> pathlib.Path:
3333

3434

3535
def get_teamocil_dir() -> pathlib.Path:
36-
"""
37-
Return teamocil configuration directory.
36+
"""Return teamocil configuration directory.
3837
3938
Returns
4039
-------
@@ -66,6 +65,7 @@ def command_import(
6665
def create_import_subparser(
6766
parser: argparse.ArgumentParser,
6867
) -> argparse.ArgumentParser:
68+
"""Augment :class:`argparse.ArgumentParser` with ``import`` subparser."""
6969
importsubparser = parser.add_subparsers(
7070
title="commands", description="valid commands", help="additional help"
7171
)
@@ -117,7 +117,10 @@ def create_import_subparser(
117117

118118

119119
class ImportConfigFn(t.Protocol):
120+
"""Typing for import configuration callback function."""
121+
120122
def __call__(self, workspace_dict: t.Dict[str, t.Any]) -> t.Dict[str, t.Any]:
123+
"""Execute tmuxp import function."""
121124
...
122125

123126

@@ -126,6 +129,7 @@ def import_config(
126129
importfunc: ImportConfigFn,
127130
parser: t.Optional[argparse.ArgumentParser] = None,
128131
) -> None:
132+
"""Import a configuration from a workspace_file."""
129133
existing_workspace_file = ConfigReader._from_file(pathlib.Path(workspace_file))
130134
cfg_reader = ConfigReader(importfunc(existing_workspace_file))
131135

@@ -175,7 +179,9 @@ def command_import_tmuxinator(
175179
workspace_file: str,
176180
parser: t.Optional[argparse.ArgumentParser] = None,
177181
) -> None:
178-
"""Convert a tmuxinator config from workspace_file to tmuxp format and import
182+
"""Entrypoint for ``tmuxp import tmuxinator`` subcommand.
183+
184+
Converts a tmuxinator config from workspace_file to tmuxp format and import
179185
it into tmuxp.
180186
"""
181187
workspace_file = find_workspace_file(
@@ -188,7 +194,9 @@ def command_import_teamocil(
188194
workspace_file: str,
189195
parser: t.Optional[argparse.ArgumentParser] = None,
190196
) -> None:
191-
"""Convert a teamocil config from workspace_file to tmuxp format and import
197+
"""Entrypoint for ``tmuxp import teamocil`` subcommand.
198+
199+
Convert a teamocil config from workspace_file to tmuxp format and import
192200
it into tmuxp.
193201
"""
194202
workspace_file = find_workspace_file(

0 commit comments

Comments
 (0)