aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/cli.py
diff options
context:
space:
mode:
authorDennis Fink2026-11-16 09:27:29 +0100
committerDennis Fink2026-11-16 09:27:29 +0100
commit85b10c38f39732421a230d938adddc7805d0e001 (patch)
tree396f29962fac45245c6f1486e188ad905588659d /webmentions_ssg/cli.py
parenteb404d9a1a328278c92753e65100579e7ad98e48 (diff)
downloadwebmentions-ssg-85b10c38f39732421a230d938adddc7805d0e001.tar.gz
webmentions-ssg-85b10c38f39732421a230d938adddc7805d0e001.zip
style(core): reorder module declarations
Group globals and data classes near module imports, keep primary classes and functions together, and move implementation helpers after their public callers. Reorder Alembic setup so configuration happens after the required helpers are defined, without changing runtime behavior.
Diffstat (limited to 'webmentions_ssg/cli.py')
-rw-r--r--webmentions_ssg/cli.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/webmentions_ssg/cli.py b/webmentions_ssg/cli.py
index 225a39f..3448bbb 100644
--- a/webmentions_ssg/cli.py
+++ b/webmentions_ssg/cli.py
@@ -18,6 +18,8 @@ from .extensions import db, mail
from .models import User
USERS_CLI = AppGroup("users", help="Manage users.")
+MAIL_CLI = AppGroup("mail", help="Handle mail")
+DB_CLI = AppGroup("db", help="Handle database")
def _get_user_or_fail(username: str):
@@ -118,9 +120,6 @@ def delete_user(username: str, yes: bool) -> None:
click.echo(f"Deleted user {username!r}.")
-MAIL_CLI = AppGroup("mail", help="Handle mail")
-
-
@MAIL_CLI.command("test", help="Send an email to test the SMTP configuration")
@click.option("--to", "recipient", help="Recipient address (defaults to DIGEST_EMAIL).")
def send_test_mail(recipient: str | None) -> None:
@@ -157,9 +156,6 @@ def send_test_mail(recipient: str | None) -> None:
click.echo(f"Test email sent to {recipient}.")
-DB_CLI = AppGroup("db", help="Handle database")
-
-
def _existing_table_names() -> set[str]:
"""Return existing table names without modifying the database schema.