Skip to content

Commit

Permalink
Filter ports
Browse files Browse the repository at this point in the history
  • Loading branch information
michel-cf authored Sep 12, 2016
1 parent 0a3ce26 commit 1d2f6fe
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions BlocklyServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@ def index(self):
def ports(self):
cherrypy.response.headers['Access-Control-Allow-Origin'] = '*'
self.queue.put((3, 'DEBUG', 'Port list retrieved'))
return self.propellerLoad.get_ports()

ports = self.propellerLoad.get_ports()
filtered_ports = []
for port in ports:
if ' bt ' not in port.lower() and 'bluetooth' not in port.lower():
filtered_ports.append(port)
return filtered_ports



@cherrypy.expose(alias='compile.action')
Expand Down Expand Up @@ -101,4 +108,4 @@ def stop(queue):
queue.put((10, 'INFO', 'Server disconnected'))

if __name__ == '__main__':
main(PORT, VERSION, None)
main(PORT, VERSION, None)

0 comments on commit 1d2f6fe

Please sign in to comment.