Skip to content

Commit ff6b14a

Browse files
authored
Merge pull request #884 from bridadan/add_requirements
Add requirements
2 parents aeb9bcb + 691b919 commit ff6b14a

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

mbed/mbed.py

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1817,23 +1817,20 @@ def detect_single_target(self, info=None):
18171817

18181818
def get_detected_targets(self):
18191819
targets = []
1820-
try:
1821-
import mbed_lstools
1822-
oldError = None
1823-
if os.name == 'nt':
1824-
oldError = ctypes.windll.kernel32.SetErrorMode(1) # Disable Windows error box temporarily. note that SEM_FAILCRITICALERRORS = 1
1825-
mbeds = mbed_lstools.create()
1826-
detect_muts_list = mbeds.list_mbeds()
1827-
if os.name == 'nt':
1828-
ctypes.windll.kernel32.SetErrorMode(oldError)
1829-
1830-
for mut in detect_muts_list:
1831-
targets.append({
1832-
'id': mut['target_id'], 'name': mut['platform_name'],
1833-
'mount': mut['mount_point'], 'serial': mut['serial_port']
1834-
})
1835-
except (IOError, ImportError, OSError):
1836-
return False
1820+
import mbed_os_tools.detect
1821+
oldError = None
1822+
if os.name == 'nt':
1823+
oldError = ctypes.windll.kernel32.SetErrorMode(1) # Disable Windows error box temporarily. note that SEM_FAILCRITICALERRORS = 1
1824+
mbeds = mbed_os_tools.detect.create()
1825+
detect_muts_list = mbeds.list_mbeds()
1826+
if os.name == 'nt':
1827+
ctypes.windll.kernel32.SetErrorMode(oldError)
1828+
1829+
for mut in detect_muts_list:
1830+
targets.append({
1831+
'id': mut['target_id'], 'name': mut['platform_name'],
1832+
'mount': mut['mount_point'], 'serial': mut['serial_port']
1833+
})
18371834

18381835
return targets
18391836

setup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,8 @@
3939
"License :: OSI Approved :: Apache Software License",
4040
"Operating System :: OS Independent",
4141
),
42+
install_requires=[
43+
"pyserial>=3.0,<4.0",
44+
"mbed-os-tools<0.1.0",
45+
]
4246
)

0 commit comments

Comments
 (0)