summaryrefslogtreecommitdiff
path: root/serial
diff options
context:
space:
mode:
authorcliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2014-07-31 23:32:06 +0000
committercliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2014-07-31 23:32:06 +0000
commit0eb13de9799897a80f3fb91bef32a5c631c05bb4 (patch)
treeaaade427f17e46490184f37011cbed890ef6d0bc /serial
parentd5069fea2418f668d7e83cf3fafe78bf1379f528 (diff)
downloadpyserial-0eb13de9799897a80f3fb91bef32a5c631c05bb4.tar.gz
[Patch pyserial:32] Module list_ports for linux should include the product information as description.
git-svn-id: http://svn.code.sf.net/p/pyserial/code/trunk/pyserial@498 f19166aa-fa4f-0410-85c2-fa1106f25c8a
Diffstat (limited to 'serial')
-rw-r--r--serial/tools/list_ports_linux.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/serial/tools/list_ports_linux.py b/serial/tools/list_ports_linux.py
index 0a23e09..d3fa0e4 100644
--- a/serial/tools/list_ports_linux.py
+++ b/serial/tools/list_ports_linux.py
@@ -110,6 +110,12 @@ def describe(device):
sys_dev_path = '/sys/class/tty/%s/device/interface' % (base,)
if os.path.exists(sys_dev_path):
return read_line(sys_dev_path)
+ # USB Product Information
+ sys_dev_path = '/sys/class/tty/%s/device' % (base,)
+ if os.path.exists(sys_dev_path):
+ product_name_file = os.path.dirname(os.path.realpath(sys_dev_path)) + "/product"
+ if os.path.exists(product_name_file):
+ return read_line(product_name_file)
return base
def hwinfo(device):