remove CoreClient.modified_service_node. When a new CORE node is created, assign default services right away (instead of leaving it empty), therefore no more confusion whether [] means empty service or means CORE node with default services
This commit is contained in:
parent
4037da49c2
commit
580641f5d9
3 changed files with 6 additions and 55 deletions
|
@ -85,7 +85,6 @@ class CoreClient:
|
|||
self.handling_events = None
|
||||
self.xml_dir = None
|
||||
self.xml_file = None
|
||||
self.modified_service_nodes = set()
|
||||
|
||||
@property
|
||||
def client(self):
|
||||
|
@ -112,7 +111,6 @@ class CoreClient:
|
|||
self.links.clear()
|
||||
self.hooks.clear()
|
||||
self.emane_config = None
|
||||
self.modified_service_nodes.clear()
|
||||
for mobility_player in self.mobility_players.values():
|
||||
mobility_player.handle_close()
|
||||
self.mobility_players.clear()
|
||||
|
@ -815,6 +813,7 @@ class CoreClient:
|
|||
if NodeUtils.is_custom(node_type, model):
|
||||
services = NodeUtils.get_custom_node_services(self.app.guiconfig, model)
|
||||
node.services[:] = services
|
||||
# assign default services to CORE node
|
||||
else:
|
||||
services = self.default_services.get(model, None)
|
||||
if services:
|
||||
|
@ -840,7 +839,6 @@ class CoreClient:
|
|||
logging.error("unknown node: %s", node_id)
|
||||
continue
|
||||
del self.canvas_nodes[node_id]
|
||||
self.modified_service_nodes.discard(node_id)
|
||||
for edge in canvas_node.edges:
|
||||
if edge in edges:
|
||||
continue
|
||||
|
@ -1056,9 +1054,6 @@ class CoreClient:
|
|||
)
|
||||
return dict(config)
|
||||
|
||||
def service_been_modified(self, node_id: int) -> bool:
|
||||
return node_id in self.modified_service_nodes
|
||||
|
||||
def execute_script(self, script):
|
||||
response = self.client.execute_script(script)
|
||||
logging.info("execute python script %s", response)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue