Commit 10098f37 authored by Juergen Hasch's avatar Juergen Hasch Committed by GitHub

Merge pull request #8 from juhasch/fix/windows

Fix Windows autodetect
parents 90387d28 dacac6fe
...@@ -145,6 +145,8 @@ class BBIO_base: ...@@ -145,6 +145,8 @@ class BBIO_base:
for port in ports: for port in ports:
if len(port) == 3 and '0403:6001' in port[2]: if len(port) == 3 and '0403:6001' in port[2]:
return port[0] return port[0]
if len(port) == 3 and 'PID=0403,VID=6001' in port[2]:
return port[0]
else: else:
ports = list_ports.comports() ports = list_ports.comports()
for port in ports: for port in ports:
...@@ -174,6 +176,8 @@ class BBIO_base: ...@@ -174,6 +176,8 @@ class BBIO_base:
if portname == '': if portname == '':
portname = self.get_port() portname = self.get_port()
if portname == '':
raise IOError('Could not autodetect a BusPirate device.')
self.portname = portname self.portname = portname
try: try:
......
...@@ -15,6 +15,7 @@ setup( ...@@ -15,6 +15,7 @@ setup(
url = "http://dangerousprototypes.com/docs/Bus_Pirate_Scripting_in_Python", url = "http://dangerousprototypes.com/docs/Bus_Pirate_Scripting_in_Python",
packages=['pyBusPirateLite'], packages=['pyBusPirateLite'],
long_description=read('README.md'), long_description=read('README.md'),
install_requires=['pyserial'],
classifiers=[ classifiers=[
"Development Status :: 4 - Beta", "Development Status :: 4 - Beta",
"Topic :: Utilities", "Topic :: Utilities",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment