mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
Format code
This commit is contained in:
@ -132,7 +132,7 @@ if env.GetOption("clean"):
|
||||
env.PioClean(env.subst("$BUILD_DIR"))
|
||||
env.Exit(0)
|
||||
elif not int(ARGUMENTS.get("PIOVERBOSE", 0)):
|
||||
print ("Verbose mode can be enabled via `-v, --verbose` option")
|
||||
print("Verbose mode can be enabled via `-v, --verbose` option")
|
||||
|
||||
env.LoadProjectOptions()
|
||||
env.LoadPioPlatform()
|
||||
@ -181,12 +181,12 @@ AlwaysBuild(env.Alias("__test", DEFAULT_TARGETS))
|
||||
##############################################################################
|
||||
|
||||
if "envdump" in COMMAND_LINE_TARGETS:
|
||||
print (env.Dump())
|
||||
print(env.Dump())
|
||||
env.Exit(0)
|
||||
|
||||
if "idedata" in COMMAND_LINE_TARGETS:
|
||||
Import("projenv")
|
||||
print (
|
||||
print(
|
||||
"\n%s\n"
|
||||
% dump_json_to_unicode(
|
||||
projenv.DumpIDEData() # pylint: disable=undefined-variable
|
||||
|
@ -294,17 +294,17 @@ def VerboseAction(_, act, actstr):
|
||||
|
||||
def PioClean(env, clean_dir):
|
||||
if not isdir(clean_dir):
|
||||
print ("Build environment is clean")
|
||||
print("Build environment is clean")
|
||||
env.Exit(0)
|
||||
clean_rel_path = relpath(clean_dir)
|
||||
for root, _, files in walk(clean_dir):
|
||||
for f in files:
|
||||
dst = join(root, f)
|
||||
remove(dst)
|
||||
print (
|
||||
print(
|
||||
"Removed %s" % (dst if clean_rel_path.startswith(".") else relpath(dst))
|
||||
)
|
||||
print ("Done cleaning")
|
||||
print("Done cleaning")
|
||||
fs.rmtree(clean_dir)
|
||||
env.Exit(0)
|
||||
|
||||
|
@ -223,7 +223,7 @@ def PrintConfiguration(env): # pylint: disable=too-many-statements
|
||||
_get_packages_data(),
|
||||
):
|
||||
if data and len(data) > 1:
|
||||
print (" ".join(data))
|
||||
print(" ".join(data))
|
||||
|
||||
|
||||
def exists(_):
|
||||
|
@ -45,7 +45,7 @@ def FlushSerialBuffer(env, port):
|
||||
|
||||
def TouchSerialPort(env, port, baudrate):
|
||||
port = env.subst(port)
|
||||
print ("Forcing reset using %dbps open/close on port %s" % (baudrate, port))
|
||||
print("Forcing reset using %dbps open/close on port %s" % (baudrate, port))
|
||||
try:
|
||||
s = Serial(port=port, baudrate=baudrate)
|
||||
s.setDTR(False)
|
||||
@ -56,7 +56,7 @@ def TouchSerialPort(env, port, baudrate):
|
||||
|
||||
|
||||
def WaitForNewSerialPort(env, before):
|
||||
print ("Waiting for the new upload port...")
|
||||
print("Waiting for the new upload port...")
|
||||
prev_port = env.subst("$UPLOAD_PORT")
|
||||
new_port = None
|
||||
elapsed = 0
|
||||
@ -145,7 +145,7 @@ def AutodetectUploadPort(*args, **kwargs):
|
||||
return port
|
||||
|
||||
if "UPLOAD_PORT" in env and not _get_pattern():
|
||||
print (env.subst("Use manually specified: $UPLOAD_PORT"))
|
||||
print(env.subst("Use manually specified: $UPLOAD_PORT"))
|
||||
return
|
||||
|
||||
if env.subst("$UPLOAD_PROTOCOL") == "mbed" or (
|
||||
@ -160,7 +160,7 @@ def AutodetectUploadPort(*args, **kwargs):
|
||||
env.Replace(UPLOAD_PORT=_look_for_serial_port())
|
||||
|
||||
if env.subst("$UPLOAD_PORT"):
|
||||
print (env.subst("Auto-detected: $UPLOAD_PORT"))
|
||||
print(env.subst("Auto-detected: $UPLOAD_PORT"))
|
||||
else:
|
||||
sys.stderr.write(
|
||||
"Error: Please specify `upload_port` for environment or use "
|
||||
@ -179,7 +179,7 @@ def UploadToDisk(_, target, source, env):
|
||||
if not isfile(fpath):
|
||||
continue
|
||||
copyfile(fpath, join(env.subst("$UPLOAD_PORT"), "%s.%s" % (progname, ext)))
|
||||
print (
|
||||
print(
|
||||
"Firmware has been successfully uploaded.\n"
|
||||
"(Some boards may require manual hard reset)"
|
||||
)
|
||||
@ -249,13 +249,13 @@ def CheckUploadSize(_, target, source, env):
|
||||
program_size = _calculate_size(output, env.get("SIZEPROGREGEXP"))
|
||||
data_size = _calculate_size(output, env.get("SIZEDATAREGEXP"))
|
||||
|
||||
print ('Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"')
|
||||
print('Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"')
|
||||
if data_max_size and data_size > -1:
|
||||
print ("DATA: %s" % _format_availale_bytes(data_size, data_max_size))
|
||||
print("DATA: %s" % _format_availale_bytes(data_size, data_max_size))
|
||||
if program_size > -1:
|
||||
print ("PROGRAM: %s" % _format_availale_bytes(program_size, program_max_size))
|
||||
print("PROGRAM: %s" % _format_availale_bytes(program_size, program_max_size))
|
||||
if int(ARGUMENTS.get("PIOVERBOSE", 0)):
|
||||
print (output)
|
||||
print(output)
|
||||
|
||||
# raise error
|
||||
# if data_max_size and data_size > data_max_size:
|
||||
@ -277,9 +277,9 @@ def PrintUploadInfo(env):
|
||||
if "BOARD" in env:
|
||||
available.extend(env.BoardConfig().get("upload", {}).get("protocols", []))
|
||||
if available:
|
||||
print ("AVAILABLE: %s" % ", ".join(sorted(set(available))))
|
||||
print("AVAILABLE: %s" % ", ".join(sorted(set(available))))
|
||||
if configured:
|
||||
print ("CURRENT: upload_protocol = %s" % configured)
|
||||
print("CURRENT: upload_protocol = %s" % configured)
|
||||
|
||||
|
||||
def exists(_):
|
||||
|
@ -397,4 +397,4 @@ ProjectOptions = OrderedDict(
|
||||
|
||||
|
||||
def get_config_options_schema():
|
||||
return [option.as_dict() for option in ProjectOptions.values()]
|
||||
return [opt.as_dict() for opt in ProjectOptions.values()]
|
||||
|
Reference in New Issue
Block a user