From 7585fc243ec6bf187b9e5feb9908b3b656bb41c4 Mon Sep 17 00:00:00 2001 From: gepd Date: Mon, 12 Feb 2018 11:13:20 -0300 Subject: [PATCH] avoid to ask for a port when the upload protocol is set (issue: https://github.com/gepd/Deviot/issues/208) --- libraries/project_check.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/libraries/project_check.py b/libraries/project_check.py index 0f14c2b..91cb0d2 100644 --- a/libraries/project_check.py +++ b/libraries/project_check.py @@ -222,11 +222,20 @@ def check_port_selected(self): self.port_id = self.get_serial_port() ports_list = self.get_ports_list() + ini_path = self.get_ini_path() + ini_ready = False + + config = ReadConfig() + config.read(ini_path) + + environment = 'env:{0}'.format(self.board_id) + if(config.has_option(environment, 'upload_protocol')): + ini_ready = True port_ready = [port[1] for port in ports_list if self.port_id == port[1]] ip_device = search(r"^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$", self.port_id) if self.port_id else None - if(not port_ready and ip_device is None): + if(not port_ready and ip_device is None and not ini_ready): self.window.run_command('deviot_select_port') self.port_id = None @@ -268,6 +277,10 @@ def check_auth_ota(self): ended = True platform = self.get_platform() + + if(not platform): + return ended + ip_device = search(r"^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$", self.port_id) if(platform and 'espressif' not in platform and ip_device is not None):