Minor improvements

This commit is contained in:
Ivan Kravets
2018-01-25 18:12:36 +02:00
parent 6b826abce0
commit 1412f085b8
2 changed files with 10 additions and 11 deletions

View File

@ -183,16 +183,6 @@ if "idedata" in COMMAND_LINE_TARGETS:
"http://docs.platformio.org/page/faq.html\n\n")
env.Exit(1)
def print_upload_protocols_info( # pylint: disable=unused-argument
source, target, _):
selected = env.subst("$UPLOAD_PROTOCOL")
available = env.BoardConfig().get("upload", {}).get(
"protocols", [selected])
print "Available: %s" % ", ".join(available)
print "Selected: %s" % selected
env.AddPreAction(["upload", "program"],
Action(print_upload_protocols_info,
Action(lambda source, target, env: env.PrintUploadInfo(),
"Configuring upload protocol..."))

View File

@ -142,6 +142,14 @@ def PrintSystemInfo(env):
print "Debug: %s" % " ".join(data)
def PrintUploadInfo(env):
selected = env.subst("$UPLOAD_PROTOCOL")
available = env.BoardConfig().get("upload", {}).get(
"protocols", [selected])
print "Available: %s" % ", ".join(available)
print "Selected: %s" % selected
def exists(_):
return True
@ -152,4 +160,5 @@ def generate(env):
env.AddMethod(GetFrameworkScript)
env.AddMethod(LoadPioPlatform)
env.AddMethod(PrintSystemInfo)
env.AddMethod(PrintUploadInfo)
return env