Add more type hints
This commit is contained in:
@@ -23,15 +23,14 @@ from .. import puppet as pu, portal as po
|
||||
|
||||
ManagementRoomList = List[Tuple[str, str]]
|
||||
RoomIDList = List[str]
|
||||
PortalList = List[po.Portal]
|
||||
|
||||
|
||||
async def _find_rooms(intent: IntentAPI) -> Tuple[
|
||||
ManagementRoomList, RoomIDList, PortalList, PortalList]:
|
||||
async def _find_rooms(intent: IntentAPI) -> Tuple[ManagementRoomList, RoomIDList,
|
||||
List["po.Portal"], List["po.Portal"]]:
|
||||
management_rooms = [] # type: ManagementRoomList
|
||||
unidentified_rooms = [] # type: RoomIDList
|
||||
portals = [] # type: PortalList
|
||||
empty_portals = [] # type: PortalList
|
||||
portals = [] # type: List[po.Portal]
|
||||
empty_portals = [] # type: List[po.Portal]
|
||||
|
||||
rooms = await intent.get_joined_rooms()
|
||||
for room in rooms:
|
||||
@@ -108,8 +107,8 @@ async def clean_rooms(evt: CommandEvent):
|
||||
|
||||
|
||||
async def set_rooms_to_clean(evt, management_rooms: ManagementRoomList,
|
||||
unidentified_rooms: RoomIDList, portals: PortalList,
|
||||
empty_portals: PortalList):
|
||||
unidentified_rooms: RoomIDList, portals: List["po.Portal"],
|
||||
empty_portals: List["po.Portal"]):
|
||||
command = evt.args[0]
|
||||
rooms_to_clean = []
|
||||
if command == "clean-recommended":
|
||||
|
||||
@@ -222,7 +222,7 @@ async def bridge(evt: CommandEvent):
|
||||
"chat to this room, use `$cmdprefix+sp continue`")
|
||||
|
||||
|
||||
async def cleanup_old_portal_while_bridging(evt: CommandEvent, portal: po.Portal):
|
||||
async def cleanup_old_portal_while_bridging(evt: CommandEvent, portal: "po.Portal"):
|
||||
if not portal.mxid:
|
||||
await evt.reply("The portal seems to have lost its Matrix room between you"
|
||||
"calling `$cmdprefix+sp bridge` and this command.\n\n"
|
||||
|
||||
Reference in New Issue
Block a user