add get sub port
This commit is contained in:
parent
88da9c0ae1
commit
01234592fd
3 changed files with 17 additions and 1 deletions
15
bin/getUSBport.py
Normal file
15
bin/getUSBport.py
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import labhw
|
||||||
|
|
||||||
|
|
||||||
|
name = 'Arduino__www_arduino_cc__75833353035351903182'
|
||||||
|
name = sys.argv[1]
|
||||||
|
|
||||||
|
devices = labhw.list_USB_devices()
|
||||||
|
|
||||||
|
try:
|
||||||
|
print(devices[name])
|
||||||
|
except KeyError as e:
|
||||||
|
raise RuntimeError(f"unknown device {name}")
|
|
@ -1,4 +1,4 @@
|
||||||
__version__ = '0.1.3'
|
__version__ = '0.1.4'
|
||||||
|
|
||||||
from .LTS import *
|
from .LTS import *
|
||||||
from .USBdev import *
|
from .USBdev import *
|
||||||
|
|
1
setup.py
1
setup.py
|
@ -32,6 +32,7 @@ setup(
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
long_description_content_type='text/markdown',
|
long_description_content_type='text/markdown',
|
||||||
scripts = ['bin/listUSBdevice.py',
|
scripts = ['bin/listUSBdevice.py',
|
||||||
|
'bin/getUSBport.py',
|
||||||
],
|
],
|
||||||
|
|
||||||
# Automatically find packages in the current directory
|
# Automatically find packages in the current directory
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue