mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-12 08:14:19 -05:00
Add additional types to the federation transport server. (#10213)
This commit is contained in:
parent
717f73c411
commit
0555d7b0dc
1
changelog.d/10213.misc
Normal file
1
changelog.d/10213.misc
Normal file
@ -0,0 +1 @@
|
||||
Add type hints to the federation servlets.
|
File diff suppressed because it is too large
Load Diff
@ -109,12 +109,22 @@ def parse_boolean_from_args(args, name, default=None, required=False):
|
||||
return default
|
||||
|
||||
|
||||
@overload
|
||||
def parse_bytes_from_args(
|
||||
args: Dict[bytes, List[bytes]],
|
||||
name: str,
|
||||
default: Optional[bytes] = None,
|
||||
) -> Optional[bytes]:
|
||||
...
|
||||
|
||||
|
||||
@overload
|
||||
def parse_bytes_from_args(
|
||||
args: Dict[bytes, List[bytes]],
|
||||
name: str,
|
||||
default: Literal[None] = None,
|
||||
required: Literal[True] = True,
|
||||
*,
|
||||
required: Literal[True],
|
||||
) -> bytes:
|
||||
...
|
||||
|
||||
@ -197,7 +207,12 @@ def parse_string(
|
||||
"""
|
||||
args = request.args # type: Dict[bytes, List[bytes]] # type: ignore
|
||||
return parse_string_from_args(
|
||||
args, name, default, required, allowed_values, encoding
|
||||
args,
|
||||
name,
|
||||
default,
|
||||
required=required,
|
||||
allowed_values=allowed_values,
|
||||
encoding=encoding,
|
||||
)
|
||||
|
||||
|
||||
@ -227,7 +242,20 @@ def parse_strings_from_args(
|
||||
args: Dict[bytes, List[bytes]],
|
||||
name: str,
|
||||
default: Optional[List[str]] = None,
|
||||
required: Literal[True] = True,
|
||||
*,
|
||||
allowed_values: Optional[Iterable[str]] = None,
|
||||
encoding: str = "ascii",
|
||||
) -> Optional[List[str]]:
|
||||
...
|
||||
|
||||
|
||||
@overload
|
||||
def parse_strings_from_args(
|
||||
args: Dict[bytes, List[bytes]],
|
||||
name: str,
|
||||
default: Optional[List[str]] = None,
|
||||
*,
|
||||
required: Literal[True],
|
||||
allowed_values: Optional[Iterable[str]] = None,
|
||||
encoding: str = "ascii",
|
||||
) -> List[str]:
|
||||
@ -239,6 +267,7 @@ def parse_strings_from_args(
|
||||
args: Dict[bytes, List[bytes]],
|
||||
name: str,
|
||||
default: Optional[List[str]] = None,
|
||||
*,
|
||||
required: bool = False,
|
||||
allowed_values: Optional[Iterable[str]] = None,
|
||||
encoding: str = "ascii",
|
||||
@ -299,7 +328,20 @@ def parse_string_from_args(
|
||||
args: Dict[bytes, List[bytes]],
|
||||
name: str,
|
||||
default: Optional[str] = None,
|
||||
required: Literal[True] = True,
|
||||
*,
|
||||
allowed_values: Optional[Iterable[str]] = None,
|
||||
encoding: str = "ascii",
|
||||
) -> Optional[str]:
|
||||
...
|
||||
|
||||
|
||||
@overload
|
||||
def parse_string_from_args(
|
||||
args: Dict[bytes, List[bytes]],
|
||||
name: str,
|
||||
default: Optional[str] = None,
|
||||
*,
|
||||
required: Literal[True],
|
||||
allowed_values: Optional[Iterable[str]] = None,
|
||||
encoding: str = "ascii",
|
||||
) -> str:
|
||||
|
Loading…
Reference in New Issue
Block a user