Skip to content

Commit

Permalink
Uniq serial ports
Browse files Browse the repository at this point in the history
  • Loading branch information
Harvie committed Jan 9, 2019
1 parent 53f29aa commit 265383a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bCNC/FilePage.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,14 @@ def comportRefresh(self, dbg=False):
devices += sorted(["spy://"+x[0]+"?raw"+"\t(Debug) "+x[1] for x in comports()])
devices += ['', 'socket://localhost:23', 'rfc2217://localhost:2217']

self.portCombo.fill(devices)
#Clean neighbour duplicates
devices_clean = []
devprev = '';
for i in devices:
if i.split("\t")[0] != devprev: devices_clean += [i]
devprev = i.split("\t")[0]

self.portCombo.fill(devices_clean)

#-----------------------------------------------------------------------
def saveConfig(self):
Expand Down

0 comments on commit 265383a

Please sign in to comment.