mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-07 16:35:05 -04:00
Change HomeServer definition to work with typing.
Duplicating function signatures between server.py and server.pyi is silly. This commit changes that by changing all `build_*` methods to `get_*` methods and changing the `_make_dependency_method` to work work as a descriptor that caches the produced value. There are some changes in other files that were made to fix the typing in server.py.
This commit is contained in:
parent
aa827b6ad7
commit
0f1afbe8dc
7 changed files with 264 additions and 399 deletions
|
@ -25,8 +25,12 @@ import sys
|
|||
if sys.version_info[0:2] >= (3, 6):
|
||||
import secrets
|
||||
|
||||
def Secrets():
|
||||
return secrets
|
||||
class Secrets:
|
||||
def token_bytes(self, nbytes=32):
|
||||
return secrets.token_bytes(nbytes)
|
||||
|
||||
def token_hex(self, nbytes=32):
|
||||
return secrets.token_hex(nbytes)
|
||||
|
||||
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue