generated from sco1/py-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
396 additions
and
178 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,4 +45,4 @@ htmlcov | |
# mypy | ||
.mypy_cache/ | ||
|
||
sample_data/ | ||
sample_data/ |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import os | ||
from pathlib import Path | ||
|
||
import typer | ||
from dotenv import load_dotenv | ||
from sco1_misc.prompts import prompt_for_dir, prompt_for_file | ||
|
||
MIN_ALT_LOSS = 200 | ||
MIN_FIRMWARE = 5 | ||
|
||
load_dotenv() | ||
start_dir = os.environ.get("PROMPT_START_DIR", ".") | ||
PROMPT_START_DIR = Path(start_dir) | ||
|
||
dropmate_cli = typer.Typer(add_completion=False) | ||
|
||
|
||
@dropmate_cli.command() | ||
def audit( | ||
log_filepath: Path = typer.Option(exists=True, file_okay=True, dir_okay=False), | ||
min_alt_loss: int = typer.Option(default=MIN_ALT_LOSS), | ||
min_firmware: float = typer.Option(default=MIN_FIRMWARE), | ||
) -> None: | ||
if log_filepath is None: | ||
log_filepath = prompt_for_file( | ||
title="Select Flight Log", | ||
start_dir=PROMPT_START_DIR, | ||
filetypes=[ | ||
("FlySight Flight Log", "*.csv"), | ||
("Gaggle Flight Log", "*.gpx"), | ||
("All Files", "*.*"), | ||
], | ||
) | ||
|
||
raise NotImplementedError | ||
|
||
|
||
@dropmate_cli.command() | ||
def audit_bulk( | ||
log_dir: Path = typer.Option(exists=True, file_okay=False, dir_okay=True), | ||
log_pattern: str = typer.Option("*.csv"), | ||
min_alt_loss: int = typer.Option(default=MIN_ALT_LOSS), | ||
min_firmware: float = typer.Option(default=MIN_FIRMWARE), | ||
) -> None: | ||
if log_dir is None: | ||
log_dir = prompt_for_dir( | ||
title="Select directory for batch processing", start_dir=PROMPT_START_DIR | ||
) | ||
|
||
raise NotImplementedError | ||
|
||
|
||
if __name__ == "__main__": | ||
dropmate_cli() |
Oops, something went wrong.