feat: prettify streamer todo output

Signed-off-by: Konstantin Fickel <mail@konstantinfickel.de>
This commit is contained in:
Konstantin Fickel 2025-06-22 15:19:09 +02:00
parent ac9df7eb62
commit 28dc40ebf0
Signed by: kfickel
GPG key ID: A793722F9933C1A5
3 changed files with 16 additions and 6 deletions

View file

@ -9,6 +9,7 @@ dependencies = [
"mistletoe>=1.4.0",
"pydantic>=2.11.3",
"pydantic-settings[yaml]>=2.10.0",
"rich>=14.0.0",
"typer>=0.16.0",
"xdg-base-dirs>=6.0.2",
]

View file

@ -2,6 +2,9 @@ import glob
import os
import typer
import click
from rich import print
from rich.markdown import Markdown
from rich.panel import Panel
from shutil import move
from datetime import datetime
@ -24,13 +27,17 @@ def todo() -> None:
for task_shard in open_tasks:
print(
Panel(
Markdown(
"\n".join(
file_content.splitlines()[
task_shard.start_line - 1 : task_shard.end_line
]
)
),
title=f"{file_name}:{task_shard.start_line}",
)
)
print(f" {file_name}:{task_shard.start_line}")
@app.command()
@ -57,7 +64,7 @@ def new() -> None:
final_path = os.path.join(streamer_directory, final_file_name)
move(prelimary_path, final_path)
click.echo(f"Saved as {click.style(final_file_name, fg='yellow')}")
print(f"Saved as [yellow]{final_file_name}")
@app.callback(invoke_without_command=True)

2
uv.lock generated
View file

@ -314,6 +314,7 @@ dependencies = [
{ name = "mistletoe" },
{ name = "pydantic" },
{ name = "pydantic-settings", extra = ["yaml"] },
{ name = "rich" },
{ name = "typer" },
{ name = "xdg-base-dirs" },
]
@ -332,6 +333,7 @@ requires-dist = [
{ name = "mistletoe", specifier = ">=1.4.0" },
{ name = "pydantic", specifier = ">=2.11.3" },
{ name = "pydantic-settings", extras = ["yaml"], specifier = ">=2.10.0" },
{ name = "rich", specifier = ">=14.0.0" },
{ name = "typer", specifier = ">=0.16.0" },
{ name = "xdg-base-dirs", specifier = ">=6.0.2" },
]