mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-31 10:37:13 +02:00
Sort debug tools by name
This commit is contained in:
@ -731,16 +731,18 @@ class PlatformBoardConfig(object):
|
|||||||
(tool_name, ", ".join(sorted(debug_tools.keys()))))
|
(tool_name, ", ".join(sorted(debug_tools.keys()))))
|
||||||
|
|
||||||
# automatically select best tool
|
# automatically select best tool
|
||||||
default = []
|
data = {"default": [], "onboard": [], "external": []}
|
||||||
onboard = []
|
|
||||||
external = []
|
|
||||||
for key, value in debug_tools.items():
|
for key, value in debug_tools.items():
|
||||||
if value.get("default"):
|
if value.get("default"):
|
||||||
default.append(key)
|
data['default'].append(key)
|
||||||
elif value.get("onboard"):
|
elif value.get("onboard"):
|
||||||
onboard.append(key)
|
data['onboard'].append(key)
|
||||||
external.append(key)
|
data['external'].append(key)
|
||||||
|
|
||||||
assert default or onboard or external
|
for key, value in data.items():
|
||||||
return (default[0] if default else onboard[0]
|
print key
|
||||||
if onboard else external[0])
|
if not value:
|
||||||
|
continue
|
||||||
|
return sorted(value)[0]
|
||||||
|
|
||||||
|
assert any(item for item in data)
|
||||||
|
Reference in New Issue
Block a user