Compare commits
2 commits
173d23addf
...
444839b8e6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
444839b8e6 | ||
|
|
dbd622ed9d |
2 changed files with 14 additions and 4 deletions
5
justfile
5
justfile
|
|
@ -8,12 +8,13 @@ setup:
|
||||||
console:
|
console:
|
||||||
uv run textual console
|
uv run textual console
|
||||||
|
|
||||||
|
the_app := "teilchensammler_cli.main"
|
||||||
# run app with logs going to console
|
# run app with logs going to console
|
||||||
run-dev:
|
run-dev:
|
||||||
uv run textual run --dev src/teilchensammler_cli/__init__.py
|
uv run textual run --dev {{ the_app }}
|
||||||
|
|
||||||
run:
|
run:
|
||||||
uv run python -m teilchensammler_cli.main
|
uv run python -m {{ the_app }}
|
||||||
|
|
||||||
uv_export_options := "--frozen --format requirements.txt --quiet --no-install-project"
|
uv_export_options := "--frozen --format requirements.txt --quiet --no-install-project"
|
||||||
exports-deps:
|
exports-deps:
|
||||||
|
|
|
||||||
|
|
@ -6,17 +6,23 @@ import logging
|
||||||
|
|
||||||
from sqlmodel import Session
|
from sqlmodel import Session
|
||||||
from textual.app import App
|
from textual.app import App
|
||||||
|
from textual.logging import TextualHandler
|
||||||
|
|
||||||
from .database import create_db_and_tables, engine
|
from .database import create_db_and_tables, engine
|
||||||
from .models import Teilchen, make_teilchen_input
|
from .models import Teilchen, make_teilchen_input
|
||||||
from .tui import AddInventoryScreen
|
from .tui import AddInventoryScreen
|
||||||
|
|
||||||
|
logging.basicConfig(
|
||||||
|
level="NOTSET",
|
||||||
|
handlers=[TextualHandler()],
|
||||||
|
)
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class SammlerApp(App[None]):
|
class SammlerApp(App[None]):
|
||||||
async def on_mount(self) -> None:
|
async def on_mount(self) -> None:
|
||||||
create_db_and_tables()
|
create_db_and_tables()
|
||||||
|
try_this()
|
||||||
_ = self.push_screen(AddInventoryScreen())
|
_ = self.push_screen(AddInventoryScreen())
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -36,11 +42,14 @@ def try_this():
|
||||||
session.commit()
|
session.commit()
|
||||||
session.refresh(db_teilchen)
|
session.refresh(db_teilchen)
|
||||||
|
|
||||||
print(f"{db_teilchen=}")
|
logger.info(f"{db_teilchen=}")
|
||||||
|
|
||||||
|
|
||||||
|
app = SammlerApp()
|
||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
app = SammlerApp()
|
# app = SammlerApp()
|
||||||
app.run()
|
app.run()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue