mirror of
https://github.com/zulip/zulip.git
synced 2025-10-22 20:42:14 +00:00
python: Elide type=str from argparse arguments.
This commit is contained in:
committed by
Tim Abbott
parent
ca01de84be
commit
1e943ae7df
@@ -246,7 +246,6 @@ group = parser.add_mutually_exclusive_group(required=True)
|
|||||||
group.add_argument(
|
group.add_argument(
|
||||||
"--thread",
|
"--thread",
|
||||||
nargs="+",
|
nargs="+",
|
||||||
type=str,
|
|
||||||
help="Path of the file where the thread for screenshot is present",
|
help="Path of the file where the thread for screenshot is present",
|
||||||
)
|
)
|
||||||
fixture_group = parser.add_argument_group("thread")
|
fixture_group = parser.add_argument_group("thread")
|
||||||
|
@@ -17,12 +17,10 @@ class Command(ZulipBaseCommand):
|
|||||||
group = parser.add_mutually_exclusive_group(required=True)
|
group = parser.add_mutually_exclusive_group(required=True)
|
||||||
group.add_argument(
|
group.add_argument(
|
||||||
"--enable",
|
"--enable",
|
||||||
type=str,
|
|
||||||
help="Name of the authentication backend to enable",
|
help="Name of the authentication backend to enable",
|
||||||
)
|
)
|
||||||
group.add_argument(
|
group.add_argument(
|
||||||
"--disable",
|
"--disable",
|
||||||
type=str,
|
|
||||||
help="Name of the authentication backend to disable",
|
help="Name of the authentication backend to disable",
|
||||||
)
|
)
|
||||||
group.add_argument(
|
group.add_argument(
|
||||||
|
@@ -20,13 +20,11 @@ class Command(BaseCommand):
|
|||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--user",
|
"--user",
|
||||||
help="User to drop privileges to, if started as root.",
|
help="User to drop privileges to, if started as root.",
|
||||||
type=str,
|
|
||||||
required=(os.geteuid() == 0),
|
required=(os.geteuid() == 0),
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--group",
|
"--group",
|
||||||
help="Group to drop privileges to, if started as root.",
|
help="Group to drop privileges to, if started as root.",
|
||||||
type=str,
|
|
||||||
required=(os.geteuid() == 0),
|
required=(os.geteuid() == 0),
|
||||||
)
|
)
|
||||||
tls_cert: str | None = None
|
tls_cert: str | None = None
|
||||||
@@ -44,13 +42,11 @@ class Command(BaseCommand):
|
|||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--tls-cert",
|
"--tls-cert",
|
||||||
help="Path to TLS certificate chain file",
|
help="Path to TLS certificate chain file",
|
||||||
type=str,
|
|
||||||
default=tls_cert,
|
default=tls_cert,
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--tls-key",
|
"--tls-key",
|
||||||
help="Path to TLS private key file",
|
help="Path to TLS private key file",
|
||||||
type=str,
|
|
||||||
default=tls_key,
|
default=tls_key,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -14,9 +14,7 @@ class Command(BaseCommand):
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
def add_arguments(self, parser: CommandParser) -> None:
|
def add_arguments(self, parser: CommandParser) -> None:
|
||||||
parser.add_argument(
|
parser.add_argument("listen", help="[Port, or address:port, to bind HTTP server to]")
|
||||||
"listen", help="[Port, or address:port, to bind HTTP server to]", type=str
|
|
||||||
)
|
|
||||||
local_port = 80
|
local_port = 80
|
||||||
config_file = get_config_file()
|
config_file = get_config_file()
|
||||||
if get_config(config_file, "application_server", "http_only", False):
|
if get_config(config_file, "application_server", "http_only", False):
|
||||||
|
@@ -29,7 +29,6 @@ Usage:
|
|||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--remove-key",
|
"--remove-key",
|
||||||
type=str,
|
|
||||||
metavar="PUBLIC_KEY",
|
metavar="PUBLIC_KEY",
|
||||||
help="Remove the key pair associated with the given public key from the `push_registration_encryption_keys` map.",
|
help="Remove the key pair associated with the given public key from the `push_registration_encryption_keys` map.",
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user