mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
List Mac OS X ttys
This commit is contained in:
parent
54c77b2f48
commit
80259c7071
@ -9,6 +9,7 @@ import sys, os, os.path
|
||||
from time import sleep
|
||||
from os.path import expanduser
|
||||
import gtksourceview2 as gtksourceview
|
||||
from glob import glob
|
||||
|
||||
#import pydfu on Linux
|
||||
if platform.system() == "Linux":
|
||||
@ -660,7 +661,11 @@ class OMVGtk:
|
||||
serial_ports = []
|
||||
system_name = platform.system()
|
||||
|
||||
if system_name == "Windows":
|
||||
if system_name == "Linux":
|
||||
serial_ports.append("/dev/openmvcam")
|
||||
elif system_name == "Darwin":
|
||||
serial_ports.extend(glob('/dev/tty.*'))
|
||||
elif system_name == "Windows":
|
||||
for i in range(256):
|
||||
try:
|
||||
port = "COM%d"%i
|
||||
@ -669,9 +674,6 @@ class OMVGtk:
|
||||
s.close()
|
||||
except serial.SerialException:
|
||||
pass
|
||||
else:
|
||||
# Linux/Mac
|
||||
serial_ports.append("/dev/openmvcam")
|
||||
|
||||
return serial_ports
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user