diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2021-12-01 07:28:23 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-01 07:28:23 -0500 |
commit | f44d729d4ccae61bc0cdd5774acb3233eb5f7c13 (patch) | |
tree | 03ae2faa020831f8116c79d6cddcf2008dce2cf4 /synapse/config/registration.py | |
parent | Register the login redirect endpoint for v3. (#11451) (diff) | |
download | synapse-f44d729d4ccae61bc0cdd5774acb3233eb5f7c13.tar.xz |
Additional type hints for config module. (#11465)
This adds some misc. type hints to helper methods used in the `synapse.config` module.
Diffstat (limited to 'synapse/config/registration.py')
-rw-r--r-- | synapse/config/registration.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/config/registration.py b/synapse/config/registration.py index 1ddad7cb70..47853199f4 100644 --- a/synapse/config/registration.py +++ b/synapse/config/registration.py @@ -1,4 +1,5 @@ # Copyright 2015, 2016 OpenMarket Ltd +# Copyright 2021 The Matrix.org Foundation C.I.C. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -11,6 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +import argparse from typing import Optional from synapse.api.constants import RoomCreationPreset @@ -362,7 +364,7 @@ class RegistrationConfig(Config): ) @staticmethod - def add_arguments(parser): + def add_arguments(parser: argparse.ArgumentParser) -> None: reg_group = parser.add_argument_group("registration") reg_group.add_argument( "--enable-registration", @@ -371,6 +373,6 @@ class RegistrationConfig(Config): help="Enable registration for new users.", ) - def read_arguments(self, args): + def read_arguments(self, args: argparse.Namespace) -> None: if args.enable_registration is not None: self.enable_registration = strtobool(str(args.enable_registration)) |