Skip to content

Commit

Permalink
Fix Python scripts unhandled quotes (#14926)
Browse files Browse the repository at this point in the history
  • Loading branch information
tpruvot authored and thinkyhead committed Aug 13, 2019
1 parent c6be989 commit 03df3f4
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 10 deletions.
5 changes: 3 additions & 2 deletions buildroot/share/PlatformIO/scripts/alfawise_Ux0.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08010000"))
env.Replace(LDSCRIPT_PATH="buildroot/share/PlatformIO/ldscripts/alfawise_Ux0.ld")

# Encrypt ${PROGNAME}.bin and save it as 'project.bin'
# Rename ${PROGNAME}.bin and save it as 'project.bin' (No encryption on the Longer3D)
def encrypt(source, target, env):
import os

Expand All @@ -23,4 +23,5 @@ def encrypt(source, target, env):
finally:
firmware.close()
marlin_alfa.close()
env.AddPostAction('"$BUILD_DIR/${PROGNAME}.bin"', encrypt);

env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt);
6 changes: 3 additions & 3 deletions buildroot/share/PlatformIO/scripts/fysetc_STM32F1.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
join("$BUILD_DIR","${PROGNAME}.elf"),
env.VerboseAction(" ".join([
"$OBJCOPY", "-O ihex", "$TARGET", # TARGET=.pio/build/fysetc_STM32F1/firmware.elf
"'" + join("$BUILD_DIR","${PROGNAME}.hex") + "'", # Note: $BUILD_DIR is a full path
"\"" + join("$BUILD_DIR","${PROGNAME}.hex") + "\"", # Note: $BUILD_DIR is a full path
]), "Building $TARGET"))

# please keep $SOURCE variable, it will be replaced with a path to firmware
Expand All @@ -27,11 +27,11 @@
UPLOAD_TOOL="stm32flash"
platform = env.PioPlatform()
if platform.get_package_dir("tool-stm32duino") != None:
UPLOAD_TOOL=expandvars("'" + join(platform.get_package_dir("tool-stm32duino"),"stm32flash","stm32flash") + "'")
UPLOAD_TOOL=expandvars("\"" + join(platform.get_package_dir("tool-stm32duino"),"stm32flash","stm32flash") + "\"")

env.Replace(
UPLOADER=UPLOAD_TOOL,
UPLOADCMD=expandvars(UPLOAD_TOOL + " -v -i rts,-dtr,dtr $UPLOAD_PORT -R -w '" + join("$BUILD_DIR","${PROGNAME}.hex") + "'")
UPLOADCMD=expandvars(UPLOAD_TOOL + " -v -i rts,-dtr,dtr $UPLOAD_PORT -R -w \"" + join("$BUILD_DIR","${PROGNAME}.hex")+"\"")
)

# Python callback
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ def addboot(source,target,env):
os.rename(target[0].path, firmware_without_bootloader_dir)
#os.rename(target[0].dir.path+'/firmware_with_bootloader.bin', target[0].dir.path+'/firmware.bin')

env.AddPostAction('"$BUILD_DIR/${PROGNAME}.bin"', addboot);
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", addboot);

2 changes: 1 addition & 1 deletion buildroot/share/PlatformIO/scripts/mks_robin.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ def encrypt(source, target, env):
finally:
firmware.close()
robin.close()
env.AddPostAction('"$BUILD_DIR/${PROGNAME}.bin"', encrypt);
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt);
2 changes: 1 addition & 1 deletion buildroot/share/PlatformIO/scripts/mks_robin_lite.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ def encrypt(source, target, env):
finally:
firmware.close()
robin.close()
env.AddPostAction('"$BUILD_DIR/${PROGNAME}.bin"', encrypt);
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt);
2 changes: 1 addition & 1 deletion buildroot/share/PlatformIO/scripts/mks_robin_mini.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ def encrypt(source, target, env):
finally:
firmware.close()
robin.close()
env.AddPostAction('"$BUILD_DIR/${PROGNAME}.bin"', encrypt);
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt);
2 changes: 1 addition & 1 deletion buildroot/share/PlatformIO/scripts/mks_robin_nano.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ def encrypt(source, target, env):
finally:
firmware.close()
robin.close()
env.AddPostAction('"$BUILD_DIR/${PROGNAME}.bin"', encrypt);
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", encrypt);

0 comments on commit 03df3f4

Please sign in to comment.