|
17 | 17 | from django.db.models import Model
|
18 | 18 | from django.db.models.query import QuerySet
|
19 | 19 | from django.utils.functional import Promise, classproperty
|
20 |
| -from django.utils.translation import gettext as _ |
21 | 20 |
|
22 | 21 | from django_typer import patch
|
23 | 22 |
|
@@ -2512,7 +2511,7 @@ def add_argument(self, *args, **kwargs):
|
2512 | 2511 | add_argument() is disabled for TyperCommands because all arguments
|
2513 | 2512 | and parameters are specified as args and kwargs on the function calls.
|
2514 | 2513 | """
|
2515 |
| - raise NotImplementedError(_("add_argument() is not supported")) |
| 2514 | + raise NotImplementedError("add_argument() is not supported") |
2516 | 2515 |
|
2517 | 2516 |
|
2518 | 2517 | class OutputWrapper(BaseOutputWrapper):
|
@@ -3073,7 +3072,7 @@ def __exit__(self, exc_type, exc_val, exc_tb):
|
3073 | 3072 | sys.exit(exc_val.exit_code)
|
3074 | 3073 | if isinstance(exc_val, click.exceptions.UsageError):
|
3075 | 3074 | err_msg = (
|
3076 |
| - _(self.missing_args_message).format( |
| 3075 | + self.missing_args_message.format( |
3077 | 3076 | parameter=getattr(getattr(exc_val, "param", None), "name", "")
|
3078 | 3077 | )
|
3079 | 3078 | if isinstance(exc_val, click.exceptions.MissingParameter)
|
@@ -3132,9 +3131,7 @@ def __init__(
|
3132 | 3131 | assert get_typer_command(self.typer_app)
|
3133 | 3132 | except RuntimeError as rerr:
|
3134 | 3133 | raise NotImplementedError(
|
3135 |
| - _( |
3136 |
| - "No commands or command groups were registered on {command}" |
3137 |
| - ).format(command=self._name) |
| 3134 | + f"No commands or command groups were registered on {self._name}" |
3138 | 3135 | ) from rerr
|
3139 | 3136 |
|
3140 | 3137 | def get_subcommand(self, *command_path: str) -> CommandNode:
|
@@ -3248,10 +3245,8 @@ def handle(self, option1: bool, option2: bool):
|
3248 | 3245 | if callable(handle):
|
3249 | 3246 | return handle(*args, **kwargs)
|
3250 | 3247 | raise NotImplementedError(
|
3251 |
| - _( |
3252 |
| - "{cls} does not implement handle(), you must call the other command " |
3253 |
| - "functions directly." |
3254 |
| - ).format(cls=self.__class__) |
| 3248 | + f"{self.__class__} does not implement handle(), you must call the other command " |
| 3249 | + "functions directly." |
3255 | 3250 | )
|
3256 | 3251 |
|
3257 | 3252 | @t.no_type_check
|
|
0 commit comments