From 94e18ce324ae743e7e5335992a615d08fc23532a Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Thu, 14 Nov 2019 11:24:55 +0100 Subject: [PATCH] STM32F1: Remove extra py imports (#15898) --- buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py | 2 -- buildroot/share/PlatformIO/scripts/chitu_crypt.py | 2 -- .../share/PlatformIO/scripts/jgaurora_a5s_a1_with_bootloader.py | 2 -- buildroot/share/PlatformIO/scripts/mks_robin.py | 1 - buildroot/share/PlatformIO/scripts/mks_robin_lite.py | 1 - buildroot/share/PlatformIO/scripts/mks_robin_mini.py | 2 -- buildroot/share/PlatformIO/scripts/mks_robin_nano.py | 1 - 7 files changed, 11 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py b/buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py index 8fa931117a..ece47ed096 100644 --- a/buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py +++ b/buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py @@ -17,8 +17,6 @@ for i, flag in enumerate(env["LINKFLAGS"]): # Rename ${PROGNAME}.bin and save it as 'project.bin' (No encryption on the Longer3D) def encrypt(source, target, env): - import os - firmware = open(target[0].path, "rb") marlin_alfa = open(target[0].dir.path +'/project.bin', "wb") length = os.path.getsize(target[0].path) diff --git a/buildroot/share/PlatformIO/scripts/chitu_crypt.py b/buildroot/share/PlatformIO/scripts/chitu_crypt.py index e2903a9cd2..d706665e90 100644 --- a/buildroot/share/PlatformIO/scripts/chitu_crypt.py +++ b/buildroot/share/PlatformIO/scripts/chitu_crypt.py @@ -113,8 +113,6 @@ def encrypt_file(input, output_file, file_length): # Encrypt ${PROGNAME}.bin and save it as 'update.cbd' def encrypt(source, target, env): - import os - firmware = open(target[0].path, "rb") update = open(target[0].dir.path +'/update.cbd', "wb") length = os.path.getsize(target[0].path) diff --git a/buildroot/share/PlatformIO/scripts/jgaurora_a5s_a1_with_bootloader.py b/buildroot/share/PlatformIO/scripts/jgaurora_a5s_a1_with_bootloader.py index 5af0e0038e..6c8a4f6034 100644 --- a/buildroot/share/PlatformIO/scripts/jgaurora_a5s_a1_with_bootloader.py +++ b/buildroot/share/PlatformIO/scripts/jgaurora_a5s_a1_with_bootloader.py @@ -16,8 +16,6 @@ for i, flag in enumerate(env["LINKFLAGS"]): #append ${PROGNAME}.bin firmware after bootloader and save it as 'jgaurora_firmware.bin' def addboot(source,target,env): - import os - firmware = open(target[0].path, "rb") lengthfirmware = os.path.getsize(target[0].path) bootloader_dir = "buildroot/share/PlatformIO/scripts/jgaurora_bootloader.bin" diff --git a/buildroot/share/PlatformIO/scripts/mks_robin.py b/buildroot/share/PlatformIO/scripts/mks_robin.py index 7db27df439..dd2342bf0d 100644 --- a/buildroot/share/PlatformIO/scripts/mks_robin.py +++ b/buildroot/share/PlatformIO/scripts/mks_robin.py @@ -16,7 +16,6 @@ for i, flag in enumerate(env["LINKFLAGS"]): # Encrypt ${PROGNAME}.bin and save it as 'Robin.bin' def encrypt(source, target, env): - import os import sys key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E] diff --git a/buildroot/share/PlatformIO/scripts/mks_robin_lite.py b/buildroot/share/PlatformIO/scripts/mks_robin_lite.py index 77d5151815..2f3ae1fa9a 100644 --- a/buildroot/share/PlatformIO/scripts/mks_robin_lite.py +++ b/buildroot/share/PlatformIO/scripts/mks_robin_lite.py @@ -17,7 +17,6 @@ for i, flag in enumerate(env["LINKFLAGS"]): # Encrypt ${PROGNAME}.bin and save it as 'mksLite.bin' def encrypt(source, target, env): - import os import sys key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E] diff --git a/buildroot/share/PlatformIO/scripts/mks_robin_mini.py b/buildroot/share/PlatformIO/scripts/mks_robin_mini.py index b68f4a5e44..d386698301 100755 --- a/buildroot/share/PlatformIO/scripts/mks_robin_mini.py +++ b/buildroot/share/PlatformIO/scripts/mks_robin_mini.py @@ -1,5 +1,4 @@ import os - Import("env") # Relocate firmware from 0x08000000 to 0x08007000 @@ -18,7 +17,6 @@ for i, flag in enumerate(env["LINKFLAGS"]): # Encrypt ${PROGNAME}.bin and save it as 'Robin_mini.bin' def encrypt(source, target, env): - import os import sys key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E] diff --git a/buildroot/share/PlatformIO/scripts/mks_robin_nano.py b/buildroot/share/PlatformIO/scripts/mks_robin_nano.py index dcb2e09490..a68fd308d4 100755 --- a/buildroot/share/PlatformIO/scripts/mks_robin_nano.py +++ b/buildroot/share/PlatformIO/scripts/mks_robin_nano.py @@ -17,7 +17,6 @@ for i, flag in enumerate(env["LINKFLAGS"]): # Encrypt ${PROGNAME}.bin and save it as 'Robin_nano.bin' def encrypt(source, target, env): - import os import sys key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E]