Skip to content

Commit

Permalink
avoid to ask for a port when the upload protocol is set (issue: #208)
Browse files Browse the repository at this point in the history
  • Loading branch information
gepd committed Feb 12, 2018
1 parent ff9afa3 commit 7585fc2
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion libraries/project_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 7585fc2

Please sign in to comment.