From 73b3698421cac32a1db17141d8546f55a5a92f92 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Sat, 21 Nov 2026 10:42:44 +0100 Subject: [PATCH] Put my logo everywhere Todo: 7808ee0a --- app_errors/app_errors/cli.py | 8 +++++++- app_errors/app_errors/tests/test_ingest.py | 10 ++++++++++ app_errors/pyproject.toml | 1 + feedback_inbox/feedback_inbox/_cli.py | 7 ++++++- feedback_inbox/feedback_inbox/tests/test_cli.py | 10 ++++++++++ feedback_inbox/pyproject.toml | 4 +++- freedays/freedays/_cli.py | 3 +++ freedays/freedays/tests/test_cli.py | 10 ++++++++++ freedays/pyproject.toml | 1 + omniroute_offload/omniroute_offload/_cli.py | 6 +++++- .../omniroute_offload/tests/test_cli.py | 10 ++++++++++ omniroute_offload/pyproject.toml | 4 +++- sickdays/pyproject.toml | 1 + sickdays/sickdays/_cli.py | 3 +++ sickdays/sickdays/gui/_window.py | 6 ++++++ sickdays/sickdays/tests/test_cli.py | 10 ++++++++++ sickdays/sickdays/tests/test_gui_no_words.py | 15 ++++++++++++++- 17 files changed, 103 insertions(+), 6 deletions(-) diff --git a/app_errors/app_errors/cli.py b/app_errors/app_errors/cli.py index a03618b..480dfbd 100644 --- a/app_errors/app_errors/cli.py +++ b/app_errors/app_errors/cli.py @@ -8,6 +8,8 @@ import datetime as dt import sys from typing import TYPE_CHECKING +from kuhy_credit import credit_line + from app_errors import ingest, store from app_errors.rtdb import DEFAULT_SESSION, RtdbError, open_rtdb @@ -16,7 +18,11 @@ if TYPE_CHECKING: def _parser() -> argparse.ArgumentParser: - parser = argparse.ArgumentParser(prog="app-errors", description=__doc__) + parser = argparse.ArgumentParser( + prog="app-errors", + description=__doc__, + epilog=credit_line(), + ) sub = parser.add_subparsers(dest="command", required=True) run = sub.add_parser("ingest", help="read RTDB and the spool, write the board reports") run.add_argument("--keep", action="store_true", help="leave RTDB entries in place") diff --git a/app_errors/app_errors/tests/test_ingest.py b/app_errors/app_errors/tests/test_ingest.py index e1e2270..db87bb0 100644 --- a/app_errors/app_errors/tests/test_ingest.py +++ b/app_errors/app_errors/tests/test_ingest.py @@ -187,3 +187,13 @@ def test_default_paths_follow_xdg(monkeypatch: pytest.MonkeyPatch, tmp_path: Pat assert paths.reports == tmp_path / "app-errors" assert paths.spool == tmp_path / "app-errors-spool" assert paths.state == tmp_path / "app-errors-ingest" / "state.json" + + +def test_help_ends_with_credit_line(capsys: pytest.CaptureFixture[str]) -> None: + """--help output ends with the kuhy credit line.""" + from kuhy_credit import credit_line + + with pytest.raises(SystemExit): + cli.main(["--help"]) + out = capsys.readouterr().out + assert out.strip().endswith(credit_line()) diff --git a/app_errors/pyproject.toml b/app_errors/pyproject.toml index ff1252d..bd60f97 100644 --- a/app_errors/pyproject.toml +++ b/app_errors/pyproject.toml @@ -5,6 +5,7 @@ description = "Shared app error and slow-wait ingest: RTDB and local spool repor requires-python = ">=3.14" dependencies = [ "crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.11.1#subdirectory=crdt-sync", + "kuhy-credit @ git+https://github.com/kuhyx/utils@kuhy-credit-v0.3.1#subdirectory=kuhy_credit", ] [project.optional-dependencies] diff --git a/feedback_inbox/feedback_inbox/_cli.py b/feedback_inbox/feedback_inbox/_cli.py index 2e8e982..e54f29f 100644 --- a/feedback_inbox/feedback_inbox/_cli.py +++ b/feedback_inbox/feedback_inbox/_cli.py @@ -9,6 +9,8 @@ import logging import time from typing import TYPE_CHECKING +from kuhy_credit import credit_line + from feedback_inbox._inbox import Importer, Outcome, Waiter, run_settled from feedback_inbox._paths import resolve_paths from feedback_inbox._todo import McpTodoClient @@ -25,7 +27,10 @@ DEFAULT_WAIT = 15.0 def _parser() -> argparse.ArgumentParser: - parser = argparse.ArgumentParser(prog="feedback-inbox") + parser = argparse.ArgumentParser( + prog="feedback-inbox", + epilog=credit_line(), + ) sub = parser.add_subparsers(dest="command", required=True) run = sub.add_parser("run", help="import new bundles as todo tasks") run.add_argument("--wait", type=float, default=DEFAULT_WAIT) diff --git a/feedback_inbox/feedback_inbox/tests/test_cli.py b/feedback_inbox/feedback_inbox/tests/test_cli.py index 0cb01ac..8e496b2 100644 --- a/feedback_inbox/feedback_inbox/tests/test_cli.py +++ b/feedback_inbox/feedback_inbox/tests/test_cli.py @@ -101,3 +101,13 @@ def test_real_paths_are_under_home( def test_module_entry_point(monkeypatch: pytest.MonkeyPatch) -> None: monkeypatch.setattr("sys.argv", ["feedback-inbox", "run", "--wait", "0"]) assert entry.run() == 0 + + +def test_help_ends_with_credit_line(capsys: pytest.CaptureFixture[str]) -> None: + """--help output ends with the kuhy credit line.""" + from kuhy_credit import credit_line + + with pytest.raises(SystemExit): + main(["--help"]) + out = capsys.readouterr().out + assert out.strip().endswith(credit_line()) diff --git a/feedback_inbox/pyproject.toml b/feedback_inbox/pyproject.toml index 4d7d580..accf14d 100644 --- a/feedback_inbox/pyproject.toml +++ b/feedback_inbox/pyproject.toml @@ -7,7 +7,9 @@ name = "feedback-inbox" version = "0.1.0" description = "Turns every game dev-feedback bundle into one todo-app task" requires-python = ">=3.14" -dependencies = [] +dependencies = [ + "kuhy-credit @ git+https://github.com/kuhyx/utils@kuhy-credit-v0.3.1#subdirectory=kuhy_credit", +] [project.scripts] feedback-inbox = "feedback_inbox._cli:main" diff --git a/freedays/freedays/_cli.py b/freedays/freedays/_cli.py index e7ffb55..1822716 100644 --- a/freedays/freedays/_cli.py +++ b/freedays/freedays/_cli.py @@ -18,6 +18,8 @@ import argparse import sys from typing import TYPE_CHECKING +from kuhy_credit import credit_line + from freedays._api import is_free_day as _is_free_day from freedays._api import mark, release, status from freedays._cli_output import emit, emit_error @@ -41,6 +43,7 @@ def _build_parser() -> argparse.ArgumentParser: "One shared pool of days on which every gate app stands down. " f"{DEFAULT_ANNUAL_BUDGET} per calendar year, resetting Jan 1." ), + epilog=credit_line(), ) sub = parser.add_subparsers(dest="command", required=True) diff --git a/freedays/freedays/tests/test_cli.py b/freedays/freedays/tests/test_cli.py index ef6f6dd..1c638c7 100644 --- a/freedays/freedays/tests/test_cli.py +++ b/freedays/freedays/tests/test_cli.py @@ -153,3 +153,13 @@ def test_sync_quiet_exits_zero_when_there_is_no_remote( monkeypatch.setattr("freedays._sync.get_client", _refuse) assert main(["sync-quiet"]) == 0 assert "no remote available" in capsys.readouterr().out + + +def test_help_ends_with_credit_line(capsys: pytest.CaptureFixture[str]) -> None: + """--help output ends with the kuhy credit line.""" + from kuhy_credit import credit_line + + with pytest.raises(SystemExit): + main(["--help"]) + out = capsys.readouterr().out + assert out.strip().endswith(credit_line()) diff --git a/freedays/pyproject.toml b/freedays/pyproject.toml index 16bdadd..6efa694 100644 --- a/freedays/pyproject.toml +++ b/freedays/pyproject.toml @@ -13,6 +13,7 @@ requires-python = ">=3.14" # ~15 lines of HMAC that were wanted live in freedays/_hmac.py instead. dependencies = [ "crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.11.1#subdirectory=crdt-sync", + "kuhy-credit @ git+https://github.com/kuhyx/utils@kuhy-credit-v0.3.1#subdirectory=kuhy_credit", ] [project.scripts] diff --git a/omniroute_offload/omniroute_offload/_cli.py b/omniroute_offload/omniroute_offload/_cli.py index 71f7dee..6dddcdc 100644 --- a/omniroute_offload/omniroute_offload/_cli.py +++ b/omniroute_offload/omniroute_offload/_cli.py @@ -16,6 +16,8 @@ import urllib.request from concurrent.futures import ThreadPoolExecutor from pathlib import Path +from kuhy_credit import credit_line + from omniroute_offload import _privacy as privacy ENDPOINT = "http://127.0.0.1:20128/v1/chat/completions" @@ -38,7 +40,9 @@ class GatewayError(RuntimeError): def parse(argv: list[str]) -> argparse.Namespace: """Command-line options.""" parser = argparse.ArgumentParser( - prog="free-llm", description=__doc__.splitlines()[0] + prog="free-llm", + description=__doc__.splitlines()[0], + epilog=credit_line(), ) parser.add_argument("prompt", help="question or instruction") parser.add_argument( diff --git a/omniroute_offload/omniroute_offload/tests/test_cli.py b/omniroute_offload/omniroute_offload/tests/test_cli.py index 985263b..f35ae9f 100644 --- a/omniroute_offload/omniroute_offload/tests/test_cli.py +++ b/omniroute_offload/omniroute_offload/tests/test_cli.py @@ -192,3 +192,13 @@ def test_tty_stdin_is_not_read( monkeypatch.setattr(sys, "stdin", Tty("must not be sent")) assert cli.main(["hi"]) == 0 assert "must not be sent" not in sent[0]["messages"][-1]["content"] + + +def test_help_ends_with_credit_line(capsys: pytest.CaptureFixture[str]) -> None: + """--help output ends with the kuhy credit line.""" + from kuhy_credit import credit_line + + with pytest.raises(SystemExit): + cli.main(["--help"]) + out = capsys.readouterr().out + assert out.strip().endswith(credit_line()) diff --git a/omniroute_offload/pyproject.toml b/omniroute_offload/pyproject.toml index b1cbe6b..b254a8d 100644 --- a/omniroute_offload/pyproject.toml +++ b/omniroute_offload/pyproject.toml @@ -7,7 +7,9 @@ name = "omniroute_offload" version = "0.1.0" description = "Offload easy LLM work to free models behind the local OmniRoute gateway" requires-python = ">=3.14" -dependencies = [] +dependencies = [ + "kuhy-credit @ git+https://github.com/kuhyx/utils@kuhy-credit-v0.3.1#subdirectory=kuhy_credit", +] [project.scripts] free-llm = "omniroute_offload._cli:main" diff --git a/sickdays/pyproject.toml b/sickdays/pyproject.toml index 4a47e2a..d984a2e 100644 --- a/sickdays/pyproject.toml +++ b/sickdays/pyproject.toml @@ -14,6 +14,7 @@ requires-python = ">=3.14" dependencies = [ "crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.11.1#subdirectory=crdt-sync", "freedays @ git+https://github.com/kuhyx/utils@freedays-v0.4.3#subdirectory=freedays", + "kuhy-credit @ git+https://github.com/kuhyx/utils@kuhy-credit-v0.3.1#subdirectory=kuhy_credit", ] [project.scripts] diff --git a/sickdays/sickdays/_cli.py b/sickdays/sickdays/_cli.py index c6d84ad..8351813 100644 --- a/sickdays/sickdays/_cli.py +++ b/sickdays/sickdays/_cli.py @@ -25,6 +25,8 @@ import importlib import sys from typing import TYPE_CHECKING +from kuhy_credit import credit_line + from sickdays._api import add_sick_day, is_sick_day, load, remove_sick_day from sickdays._cli_output import emit, emit_error from sickdays._constants import LOCKERS @@ -56,6 +58,7 @@ def _build_parser() -> argparse.ArgumentParser: "One shared pool of sick days every gate respects. No cap, no " "reason; today or later only." ), + epilog=credit_line(), ) sub = parser.add_subparsers(dest="command", required=True) add = sub.add_parser("add", help="mark a day sick (today or later)") diff --git a/sickdays/sickdays/gui/_window.py b/sickdays/sickdays/gui/_window.py index 6a8d6b4..b886cc2 100644 --- a/sickdays/sickdays/gui/_window.py +++ b/sickdays/sickdays/gui/_window.py @@ -17,6 +17,8 @@ from __future__ import annotations import tkinter as tk from typing import TYPE_CHECKING, Final +from kuhy_credit.tk import KuhyCredit + from sickdays._api import is_sick_day, load from sickdays._day import to_iso, today from sickdays._keep_api import kept_lockers @@ -84,6 +86,10 @@ class SickDaysApp: self._list = tk.Frame(left, name="upcoming", bg=tok.INK) self._list.pack(anchor="w", fill="x") self._draw_upcoming() + # Credit in the bottom-right corner of the window + KuhyCredit(root, theme="dark").place( + relx=1, rely=1, x=-tok.LG, y=-tok.LG, anchor="se" + ) def close(self, _event: object = None) -> None: """Close the window (bound to ``Escape``).""" diff --git a/sickdays/sickdays/tests/test_cli.py b/sickdays/sickdays/tests/test_cli.py index 8d239d6..71ab6f9 100644 --- a/sickdays/sickdays/tests/test_cli.py +++ b/sickdays/sickdays/tests/test_cli.py @@ -196,3 +196,13 @@ def test_importing_the_library_and_cli_never_imports_tkinter() -> None: ) done = subprocess.run([sys.executable, "-c", probe], check=False) assert done.returncode == 0 + + +def test_help_ends_with_credit_line(capsys: pytest.CaptureFixture[str]) -> None: + """--help output ends with the kuhy credit line.""" + from kuhy_credit import credit_line + + with pytest.raises(SystemExit): + main(["--help"]) + out = capsys.readouterr().out + assert out.strip().endswith(credit_line()) diff --git a/sickdays/sickdays/tests/test_gui_no_words.py b/sickdays/sickdays/tests/test_gui_no_words.py index 888aa7b..18c480e 100644 --- a/sickdays/sickdays/tests/test_gui_no_words.py +++ b/sickdays/sickdays/tests/test_gui_no_words.py @@ -27,9 +27,22 @@ LETTER = re.compile(r"[^\W\d_]") def _shown(widget: tk.Misc) -> list[str]: - """Every string ``widget`` and its descendants paint.""" + """Every string ``widget`` and its descendants paint, except the credit.""" found: list[str] = [] + # Find the credit panel frame in the toplevel so we can skip it + credit_panel = None for child in widget.winfo_children(): + if child.__class__.__name__ == "KuhyCredit" and hasattr(child, "panel"): + credit_panel = child.panel + break + + for child in widget.winfo_children(): + # Skip the KuhyCredit widget (Canvas) + if child.__class__.__name__ == "KuhyCredit": + continue + # Skip the credit panel Frame (in toplevel) and its children + if credit_panel is not None and child == credit_panel: + continue if isinstance(child, tk.Canvas): # Raw Tcl: typeshed types Canvas.type()/itemcget() too loosely. path = str(child)