adjust cli

This commit is contained in:
James Turk 2025-01-04 03:09:46 -06:00
parent 4bda161e10
commit 20b95d087b
3 changed files with 16 additions and 15 deletions

View File

@ -5,15 +5,15 @@ description = "Add your description here"
readme = "README.md" readme = "README.md"
requires-python = ">=3.10" requires-python = ">=3.10"
dependencies = [ dependencies = [
"httpx>=0.28.1", "httpx>=0.28.1",
"lxml>=5.3.0", "lxml>=5.3.0",
"peewee>=3.17.8", "peewee>=3.17.8",
"textual>=1.0.0", "textual>=1.0.0",
"typer>=0.15.1", "typer>=0.15.1",
] ]
[project.scripts] [project.scripts]
hello = "tt:hello" tt = "tt.cli:app"
[build-system] [build-system]
requires = ["hatchling"] requires = ["hatchling"]

View File

@ -1,10 +1,10 @@
import uuid
import typer import typer
import httpx import httpx
import lxml.html import lxml.html
from datetime import datetime
from typing_extensions import Annotated from typing_extensions import Annotated
from .controller import add_task from .controller import add_task
from .import_csv import import_tasks_from_csv
from . import tui
app = typer.Typer() app = typer.Typer()
@ -39,8 +39,14 @@ def new(
@app.command() @app.command()
def search(q: str): def browse():
pass tui.run()
@app.command()
def import_csv(filename: str):
import_tasks_from_csv(filename)
print("Import complete!")
if __name__ == "__main__": if __name__ == "__main__":

View File

@ -45,8 +45,3 @@ def import_tasks_from_csv(filename: str):
category_id=category_id, category_id=category_id,
) )
print(f"Imported task: {row['task']}") print(f"Imported task: {row['task']}")
if __name__ == "__main__":
import_tasks_from_csv(sys.argv[1])
print("Import complete!")