feat: implement edit-command
Some checks failed
Continuous Integration / Lint, Check & Test (push) Failing after 47s
Some checks failed
Continuous Integration / Lint, Check & Test (push) Failing after 47s
Signed-off-by: Konstantin Fickel <mail@konstantinfickel.de>
This commit is contained in:
parent
a662077831
commit
eaca24b8ae
1 changed files with 18 additions and 1 deletions
|
|
@ -2,7 +2,7 @@ import glob
|
||||||
import os
|
import os
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from shutil import move
|
from shutil import move
|
||||||
from typing import Generator
|
from typing import Annotated, Generator
|
||||||
|
|
||||||
import click
|
import click
|
||||||
import typer
|
import typer
|
||||||
|
|
@ -54,6 +54,23 @@ def todo() -> None:
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@app.command()
|
||||||
|
def edit(number: Annotated[int, typer.Argument()] = 1) -> None:
|
||||||
|
all_shards = list(all_files(TaskConfiguration))
|
||||||
|
sorted_shards = sorted(all_shards, key=lambda s: s.moment)
|
||||||
|
|
||||||
|
if abs(number) >= len(sorted_shards):
|
||||||
|
raise ValueError("Argument out of range")
|
||||||
|
|
||||||
|
selected_number = number
|
||||||
|
if selected_number >= 0:
|
||||||
|
selected_number = len(sorted_shards) - selected_number
|
||||||
|
else:
|
||||||
|
selected_number = -selected_number
|
||||||
|
|
||||||
|
click.edit(None, filename=sorted_shards[selected_number].location["file"])
|
||||||
|
|
||||||
|
|
||||||
@app.command()
|
@app.command()
|
||||||
def new() -> None:
|
def new() -> None:
|
||||||
streamer_directory = Settings().base_folder
|
streamer_directory = Settings().base_folder
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue