mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-09-21 07:24:34 -04:00
Add missing type hints to non-client REST servlets. (#10817)
Including admin, consent, key, synapse, and media. All REST servlets (the synapse.rest module) now require typed method definitions.
This commit is contained in:
parent
8c7a531e27
commit
b93259082c
27 changed files with 169 additions and 96 deletions
|
@ -12,7 +12,9 @@
|
|||
# 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.
|
||||
from synapse.http.server import JsonResource
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from synapse.http.server import HttpServer, JsonResource
|
||||
from synapse.rest import admin
|
||||
from synapse.rest.client import (
|
||||
account,
|
||||
|
@ -57,6 +59,9 @@ from synapse.rest.client import (
|
|||
voip,
|
||||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from synapse.server import HomeServer
|
||||
|
||||
|
||||
class ClientRestResource(JsonResource):
|
||||
"""Matrix Client API REST resource.
|
||||
|
@ -68,12 +73,12 @@ class ClientRestResource(JsonResource):
|
|||
* etc
|
||||
"""
|
||||
|
||||
def __init__(self, hs):
|
||||
def __init__(self, hs: "HomeServer"):
|
||||
JsonResource.__init__(self, hs, canonical_json=False)
|
||||
self.register_servlets(self, hs)
|
||||
|
||||
@staticmethod
|
||||
def register_servlets(client_resource, hs):
|
||||
def register_servlets(client_resource: HttpServer, hs: "HomeServer") -> None:
|
||||
versions.register_servlets(hs, client_resource)
|
||||
|
||||
# Deprecated in r0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue