diff --git a/justfile b/justfile index bfc462d..4ee9b47 100644 --- a/justfile +++ b/justfile @@ -8,13 +8,12 @@ setup: console: uv run textual console -the_app := "teilchensammler_cli.main" # run app with logs going to console run-dev: - uv run textual run --dev {{ the_app }} + uv run textual run --dev src/teilchensammler_cli/__init__.py run: - uv run python -m {{ the_app }} + uv run python -m teilchensammler_cli.main uv_export_options := "--frozen --format requirements.txt --quiet --no-install-project" exports-deps: diff --git a/src/teilchensammler_cli/main.py b/src/teilchensammler_cli/main.py index 3f9c1fd..8c789cb 100644 --- a/src/teilchensammler_cli/main.py +++ b/src/teilchensammler_cli/main.py @@ -6,23 +6,17 @@ import logging from sqlmodel import Session from textual.app import App -from textual.logging import TextualHandler from .database import create_db_and_tables, engine from .models import Teilchen, make_teilchen_input from .tui import AddInventoryScreen -logging.basicConfig( - level="NOTSET", - handlers=[TextualHandler()], -) logger = logging.getLogger(__name__) class SammlerApp(App[None]): async def on_mount(self) -> None: create_db_and_tables() - try_this() _ = self.push_screen(AddInventoryScreen()) @@ -42,14 +36,11 @@ def try_this(): session.commit() session.refresh(db_teilchen) - logger.info(f"{db_teilchen=}") - - -app = SammlerApp() + print(f"{db_teilchen=}") def main() -> None: - # app = SammlerApp() + app = SammlerApp() app.run()