Skip to content

Commit aed99c7

Browse files
committed
address linter recommendations
1 parent 4682483 commit aed99c7

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/aerie_cli/commands/workspace.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
from builtins import list as list_builtin
2-
from genericpath import isdir, isfile
1+
from genericpath import isdir
32
from os import walk
4-
from posixpath import commonpath, join, normpath, relpath
3+
from posixpath import join, normpath, relpath
54
from typing import Optional
65

76
import typer
@@ -39,7 +38,7 @@ def create(
3938
@app.command()
4039
def list(
4140
workspace_id: Optional[int] = typer.Option(
42-
None, "--workspace_id", "-w", help="The workspace id"
41+
None, "--workspace_id", "-w", help="Workspace id to list"
4342
),
4443
base_directory: Optional[str] = typer.Option(
4544
None, "--base_directory", "-b", help="Path of directory within workspace"
@@ -94,7 +93,7 @@ def list_workspace_contents(
9493
@app.command()
9594
def save(
9695
workspace_id: int = typer.Option(
97-
..., "--workspace_id", "-w", help="The workspace id"
96+
..., "--workspace_id", "-w", help="Id of workspace to save file to"
9897
),
9998
workspace_path: str = typer.Option(
10099
..., "--path", "-p", help="The relative path within the workspace"
@@ -132,7 +131,7 @@ def contained_files(path: str):
132131
@app.command()
133132
def get(
134133
workspace_id: int = typer.Option(
135-
..., "--workspace_id", "-w", help="The workspace id"
134+
..., "--workspace_id", "-w", help="Id of workspace to get file from"
136135
),
137136
workspace_path: str = typer.Option(
138137
..., "--path", "-p", help="The relative path within the workspace"

src/aerie_cli/persistent.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
SESSION_FILE_DIRECTORY = Path(APP_DIRS.user_config_dir).resolve().absolute()
2424
SESSION_TIMESTAMP_FSTRING = r"%Y-%jT%H-%M-%S.%f"
2525
SESSION_TIMEOUT = timedelta(hours=12)
26+
SESSION_FILE_PATTERN = "*.aerie_cli.session"
2627

2728

2829
def delete_all_persistent_files():
@@ -127,7 +128,7 @@ def _load_active_session(cls) -> None:
127128

128129
# Get any/all open sessions. List in chronological order, newest first
129130
session_files: List[Path] = [
130-
f for f in SESSION_FILE_DIRECTORY.glob("*.aerie_cli.session")
131+
f for f in SESSION_FILE_DIRECTORY.glob(SESSION_FILE_PATTERN)
131132
]
132133
session_files.sort(reverse=True)
133134

@@ -180,7 +181,7 @@ def set_active_session(cls, session: AerieHost) -> bool:
180181
return False
181182

182183
session_files: List[Path] = [
183-
f for f in SESSION_FILE_DIRECTORY.glob("*.aerie_cli.session")
184+
f for f in SESSION_FILE_DIRECTORY.glob(SESSION_FILE_PATTERN)
184185
]
185186
for session_file in session_files:
186187
session_file.unlink()
@@ -211,7 +212,7 @@ def unset_active_session(cls) -> str:
211212
except NoActiveSessionError:
212213
return None
213214

214-
fs: List[Path] = [f for f in SESSION_FILE_DIRECTORY.glob("*.aerie_cli.session")]
215+
fs: List[Path] = [f for f in SESSION_FILE_DIRECTORY.glob(SESSION_FILE_PATTERN)]
215216
for fn in fs:
216217
fn.unlink()
217218

@@ -224,7 +225,7 @@ def reset(cls) -> None:
224225
cls._active_session = None
225226

226227
# Get any/all open sessions. List in chronological order, newest first
227-
fs: List[Path] = [f for f in SESSION_FILE_DIRECTORY.glob("*.aerie_cli.session")]
228+
fs: List[Path] = [f for f in SESSION_FILE_DIRECTORY.glob(SESSION_FILE_PATTERN)]
228229
if not len(fs):
229230
return
230231
# Delete all session files

src/aerie_cli/schemas/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def __attrs_post_init__(self):
8383
if self.anchored_to_start is None:
8484
if self.anchor_id is not None:
8585
raise ValueError(
86-
f"anchor_id was specified but anchored_to_start was not"
86+
"anchor_id was specified but anchored_to_start was not"
8787
)
8888
self.anchored_to_start = True
8989

0 commit comments

Comments
 (0)