From 1d2f6fec688cbe1eb243416eb270acb3453b4823 Mon Sep 17 00:00:00 2001 From: michel-cf Date: Mon, 12 Sep 2016 22:36:15 +0200 Subject: [PATCH] Filter ports --- BlocklyServer.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/BlocklyServer.py b/BlocklyServer.py index 2736f8c..f41fa0a 100644 --- a/BlocklyServer.py +++ b/BlocklyServer.py @@ -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') @@ -101,4 +108,4 @@ def stop(queue): queue.put((10, 'INFO', 'Server disconnected')) if __name__ == '__main__': - main(PORT, VERSION, None) \ No newline at end of file + main(PORT, VERSION, None)