forked from platformio/platformio-core
Minor improvements
This commit is contained in:
@ -183,16 +183,6 @@ if "idedata" in COMMAND_LINE_TARGETS:
|
|||||||
"http://docs.platformio.org/page/faq.html\n\n")
|
"http://docs.platformio.org/page/faq.html\n\n")
|
||||||
env.Exit(1)
|
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"],
|
env.AddPreAction(["upload", "program"],
|
||||||
Action(print_upload_protocols_info,
|
Action(lambda source, target, env: env.PrintUploadInfo(),
|
||||||
"Configuring upload protocol..."))
|
"Configuring upload protocol..."))
|
||||||
|
@ -142,6 +142,14 @@ def PrintSystemInfo(env):
|
|||||||
print "Debug: %s" % " ".join(data)
|
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(_):
|
def exists(_):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@ -152,4 +160,5 @@ def generate(env):
|
|||||||
env.AddMethod(GetFrameworkScript)
|
env.AddMethod(GetFrameworkScript)
|
||||||
env.AddMethod(LoadPioPlatform)
|
env.AddMethod(LoadPioPlatform)
|
||||||
env.AddMethod(PrintSystemInfo)
|
env.AddMethod(PrintSystemInfo)
|
||||||
|
env.AddMethod(PrintUploadInfo)
|
||||||
return env
|
return env
|
||||||
|
Reference in New Issue
Block a user