Minor improvements

This commit is contained in:
Ivan Kravets
2016-06-02 01:09:05 +03:00
parent b188a05b69
commit c773c8f5d5
4 changed files with 10 additions and 12 deletions

View File

@@ -283,8 +283,9 @@ def exec_command(*args, **kwargs):
def get_serialports(use_grep=False):
def _grep_serial_ports():
assert system() != "Windows"
result = []
if system() == "Windows":
return result
if system() == "Linux":
patterns = ["/dev/%s*" % p for p in (
"ttyS", "ttyUSB", "ttyACM", "ttyAMA", "rfcomm", "ttyO")]
@@ -315,7 +316,7 @@ def get_serialports(use_grep=False):
result.append({"port": p, "description": d, "hwid": h})
# fix for PySerial
if not result and system() != "Windows":
if not result:
result = _grep_serial_ports()
return result