Skip to content

Commit f8f06d2

Browse files
committed
Finish hints for management commands
1 parent 276ecf3 commit f8f06d2

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

src/django_mysql/management/commands/cull_mysql_caches.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ def add_arguments(self, parser: argparse.ArgumentParser) -> None:
3131
help="Specify the cache alias(es) to cull.",
3232
)
3333

34-
def handle(
35-
self, *args: Any, verbosity: int, aliases: list[str], **options: Any
36-
) -> None:
34+
def handle(self, *args: Any, **options: Any) -> None:
35+
verbosity: int = options["verbosity"]
36+
aliases: list[str] = options["aliases"]
37+
3738
if not aliases:
3839
aliases = list(settings.CACHES)
3940

src/django_mysql/management/commands/dbparams.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,11 @@ def add_arguments(self, parser: argparse.ArgumentParser) -> None:
5151
"pt-online-schema-change $(./manage.py dbparams --dsn)",
5252
)
5353

54-
def handle(
55-
self, *args: Any, alias: str, show_mysql: bool, show_dsn: bool, **options: Any
56-
) -> None:
54+
def handle(self, *args: Any, **options: Any) -> None:
55+
alias: str = options["alias"]
56+
show_mysql: bool = options["show_mysql"]
57+
show_dsn: bool = options["show_dsn"]
58+
5759
try:
5860
connection = connections[alias]
5961
except ConnectionDoesNotExist:

src/django_mysql/management/commands/mysql_cache_migration.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ def add_arguments(self, parser: argparse.ArgumentParser) -> None:
3030
help="Specify the cache alias(es) to create migrations for.",
3131
)
3232

33-
def handle(self, *args: Any, aliases: list[str], **options: Any) -> None:
33+
def handle(self, *args: Any, **options: Any) -> None:
34+
aliases: list[str] = options["aliases"]
3435
if not aliases:
3536
aliases = list(settings.CACHES)
3637

0 commit comments

Comments
 (0)