Skip to content

Commit 1d2f6fe

Browse files
authored
Filter ports
1 parent 0a3ce26 commit 1d2f6fe

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

BlocklyServer.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,14 @@ def index(self):
4242
def ports(self):
4343
cherrypy.response.headers['Access-Control-Allow-Origin'] = '*'
4444
self.queue.put((3, 'DEBUG', 'Port list retrieved'))
45-
return self.propellerLoad.get_ports()
45+
46+
ports = self.propellerLoad.get_ports()
47+
filtered_ports = []
48+
for port in ports:
49+
if ' bt ' not in port.lower() and 'bluetooth' not in port.lower():
50+
filtered_ports.append(port)
51+
return filtered_ports
52+
4653

4754

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

103110
if __name__ == '__main__':
104-
main(PORT, VERSION, None)
111+
main(PORT, VERSION, None)

0 commit comments

Comments
 (0)