feat: implement basic timesheet command
All checks were successful
Continuous Integration / Lint, Check & Test (push) Successful in 44s
All checks were successful
Continuous Integration / Lint, Check & Test (push) Successful in 44s
Signed-off-by: Konstantin Fickel <mail@konstantinfickel.de>
This commit is contained in:
parent
22630773ab
commit
0a554aae14
2 changed files with 17 additions and 1 deletions
|
|
@ -18,7 +18,10 @@ from streamer.localize import (
|
||||||
from streamer.localize.preconfigured_configurations import TaskConfiguration
|
from streamer.localize.preconfigured_configurations import TaskConfiguration
|
||||||
from streamer.parse import parse_markdown_file
|
from streamer.parse import parse_markdown_file
|
||||||
from streamer.query import find_shard_by_position
|
from streamer.query import find_shard_by_position
|
||||||
|
from streamer.query.find import find_shard_by_set_dimension
|
||||||
from streamer.settings import Settings
|
from streamer.settings import Settings
|
||||||
|
from streamer.timesheet.configuration import BasicTimesheetConfiguration
|
||||||
|
from streamer.timesheet.extract import extract_timesheets
|
||||||
|
|
||||||
app = typer.Typer()
|
app = typer.Typer()
|
||||||
|
|
||||||
|
|
@ -71,6 +74,19 @@ def edit(number: Annotated[int, typer.Argument()] = 1) -> None:
|
||||||
click.edit(None, filename=sorted_shards[selected_number].location["file"])
|
click.edit(None, filename=sorted_shards[selected_number].location["file"])
|
||||||
|
|
||||||
|
|
||||||
|
@app.command()
|
||||||
|
def timesheet() -> None:
|
||||||
|
all_shards = list(all_files(BasicTimesheetConfiguration))
|
||||||
|
sheets = sorted(extract_timesheets(all_shards), key=lambda card: card.date)
|
||||||
|
for sheet in sheets:
|
||||||
|
print(sheet.date)
|
||||||
|
print(
|
||||||
|
",".join(
|
||||||
|
map(lambda card: f"{card.from_time},{card.to_time}", sheet.timecards)
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.command()
|
@app.command()
|
||||||
def new() -> None:
|
def new() -> None:
|
||||||
streamer_directory = Settings().base_folder
|
streamer_directory = Settings().base_folder
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ BasicTimesheetConfiguration = RepositoryConfiguration(
|
||||||
placements=[
|
placements=[
|
||||||
MarkerPlacement(
|
MarkerPlacement(
|
||||||
dimension=TIMESHEET_DIMENSION_NAME,
|
dimension=TIMESHEET_DIMENSION_NAME,
|
||||||
value=TimesheetPointType.Vacation.value,
|
value=TimesheetPointType.Card.value,
|
||||||
overwrites=False,
|
overwrites=False,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue