29-timesheet-management #30
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.parse import parse_markdown_file
|
||||
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.timesheet.configuration import BasicTimesheetConfiguration
|
||||
from streamer.timesheet.extract import extract_timesheets
|
||||
|
||||
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"])
|
||||
|
||||
|
||||
@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()
|
||||
def new() -> None:
|
||||
streamer_directory = Settings().base_folder
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ BasicTimesheetConfiguration = RepositoryConfiguration(
|
|||
placements=[
|
||||
MarkerPlacement(
|
||||
dimension=TIMESHEET_DIMENSION_NAME,
|
||||
value=TimesheetPointType.Vacation.value,
|
||||
value=TimesheetPointType.Card.value,
|
||||
overwrites=False,
|
||||
)
|
||||
],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue