changes to support better type checking for retrieving an arbitrary node from a session, get_node now requires an expected class that the node would be an instance of, if the returned node is not an instance a CoreError is thrown, this also helps editors pick up expected types to account for variable/function usage better as well

This commit is contained in:
Blake Harnden 2020-05-20 14:44:34 -07:00
parent 19ee367dc5
commit d5254e6a91
21 changed files with 149 additions and 126 deletions

View file

@ -7,6 +7,7 @@ from typing import Dict, List
from core.config import ConfigGroup, Configuration
from core.emane import emanemanifest
from core.emane.nodes import EmaneNet
from core.emulator.enumerations import ConfigDataTypes
from core.errors import CoreError
from core.location.mobility import WirelessModel
@ -148,7 +149,7 @@ class EmaneModel(WirelessModel):
:return: nothing
"""
try:
wlan = self.session.get_node(self.id)
wlan = self.session.get_node(self.id, EmaneNet)
wlan.setnempositions(moved_netifs)
except CoreError:
logging.exception("error during update")