use grpc method to execute python script, redraw canvas and reset session data

This commit is contained in:
Huy Pham 2020-03-02 09:01:03 -08:00
parent c1f0e385b4
commit dfc24e107f
2 changed files with 8 additions and 1 deletions

View file

@ -1064,3 +1064,9 @@ class CoreClient:
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)
if response.session_id != -1:
self.join_session(response.session_id)

View file

@ -79,5 +79,6 @@ class ExecutePythonDialog(Dialog):
def script_execute(self):
file = self.file_entry.get()
options = self.option_entry.get()
logging.debug("Execute %s with options %s", file, options)
logging.info("Execute %s with options %s", file, options)
self.app.core.execute_script(file)
self.destroy()