summary refs log tree commit diff
path: root/synapse/config/database.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2022-04-11 12:07:23 -0400
committerGitHub <noreply@github.com>2022-04-11 12:07:23 -0400
commit4586119f0b0901be64f08655d3aaaef289a51bde (patch)
tree8150ea6084a6a7a034d272654720333d01b75b9f /synapse/config/database.py
parentEnable certificate checking during complement tests (#12435) (diff)
downloadsynapse-4586119f0b0901be64f08655d3aaaef289a51bde.tar.xz
Add missing type hints to config classes. (#12402)
Diffstat (limited to 'synapse/config/database.py')
-rw-r--r--synapse/config/database.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/synapse/config/database.py b/synapse/config/database.py

index d7f2219f53..de0d3ca0f0 100644 --- a/synapse/config/database.py +++ b/synapse/config/database.py
@@ -15,8 +15,10 @@ import argparse import logging import os +from typing import Any, List from synapse.config._base import Config, ConfigError +from synapse.types import JsonDict logger = logging.getLogger(__name__) @@ -121,12 +123,12 @@ class DatabaseConnectionConfig: class DatabaseConfig(Config): section = "database" - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) + def __init__(self, *args: Any): + super().__init__(*args) - self.databases = [] + self.databases: List[DatabaseConnectionConfig] = [] - def read_config(self, config, **kwargs) -> None: + def read_config(self, config: JsonDict, **kwargs: Any) -> None: # We *experimentally* support specifying multiple databases via the # `databases` key. This is a map from a label to database config in the # same format as the `database` config option, plus an extra @@ -170,7 +172,7 @@ class DatabaseConfig(Config): self.databases = [DatabaseConnectionConfig("master", database_config)] self.set_databasepath(database_path) - def generate_config_section(self, data_dir_path, **kwargs) -> str: + def generate_config_section(self, data_dir_path: str, **kwargs: Any) -> str: return DEFAULT_CONFIG % { "database_path": os.path.join(data_dir_path, "homeserver.db") }