Skip to content

Commit 7a07c91

Browse files
Update - python scripts
1 parent 32d1440 commit 7a07c91

22 files changed

+88
-86
lines changed

.vscode/extensions.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
"marlinfirmware.auto-build",
77
"ms-vscode.cpptools-extension-pack",
88
"platformio.platformio-ide"
9-
],
10-
}
9+
]
10+
}

Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/scripts/svg2cpp.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,9 @@ def layer_matches(self):
267267
"""Are we in the correct layer?"""
268268
if not self.args.layer:
269269
return True
270-
for l in self.groups:
271-
if l and l.find(self.args.layer) != -1:
270+
target_layer = self.args.layer
271+
for group_name in self.groups:
272+
if group_name and target_layer in group_name:
272273
return True
273274
return False
274275

buildroot/share/PlatformIO/debugging/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"device": "stlink",
2323
"executable": "${workspaceRoot}/.pio/build/STM32F407VG_btt_USB_debug/firmware.elf",
2424
"openOCDLaunchCommands": [ "init", "reset init" ],
25-
"svdFile": "${env:HOME}/.platformio/platforms/ststm32@12.1.1/misc/svd/STM32F40x.svd",
25+
"svdFile": "${env:HOME}/.platformio/platforms/ststm32@12.1.1/misc/svd/STM32F40x.svd"
2626
},
2727
{
2828
"name": "Launch Sim (ggdb)",

buildroot/share/PlatformIO/scripts/SAMD21_minitronics20.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
env = pioutil.env
1111

1212
mf = env["MARLIN_FEATURES"]
13-
rxBuf = mf["RX_BUFFER_SIZE"] if "RX_BUFFER_SIZE" in mf else "0"
14-
txBuf = mf["TX_BUFFER_SIZE"] if "TX_BUFFER_SIZE" in mf else "0"
13+
rx_Buf = mf["RX_BUFFER_SIZE"] if "RX_BUFFER_SIZE" in mf else "0"
14+
tx_Buf = mf["TX_BUFFER_SIZE"] if "TX_BUFFER_SIZE" in mf else "0"
1515

16-
serialBuf = str(max(int(rxBuf), int(txBuf), 350))
16+
serialBuf = str(max(int(rx_Buf), int(tx_Buf), 350))
1717

1818
build_flags = env.get("BUILD_FLAGS")
1919
env.Replace(BUILD_FLAGS=build_flags)

buildroot/share/PlatformIO/scripts/SAMD51_grandcentral_m4.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
env = pioutil.env
1111

1212
mf = env["MARLIN_FEATURES"]
13-
rxBuf = mf["RX_BUFFER_SIZE"] if "RX_BUFFER_SIZE" in mf else "0"
14-
txBuf = mf["TX_BUFFER_SIZE"] if "TX_BUFFER_SIZE" in mf else "0"
13+
rx_Buf = mf["RX_BUFFER_SIZE"] if "RX_BUFFER_SIZE" in mf else "0"
14+
tx_Buf = mf["TX_BUFFER_SIZE"] if "TX_BUFFER_SIZE" in mf else "0"
1515

16-
serialBuf = str(max(int(rxBuf), int(txBuf), 350))
16+
serialBuf = str(max(int(rx_Buf), int(tx_Buf), 350))
1717

1818
build_flags = env.get("BUILD_FLAGS")
1919
build_flags.append("-DSERIAL_BUFFER_SIZE=" + serialBuf)

buildroot/share/PlatformIO/scripts/chitu_crypt.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ def xor_block(r0, r1, block_number, block_size, file_key):
6262
def encrypt_file(input, output_file, file_length):
6363
input_file = bytearray(input.read())
6464
block_size = 0x800
65-
key_length = 0x18
6665

6766
uid_value = uuid.uuid4()
6867
file_key = int(uid_value.hex[0:8], 16)

buildroot/share/PlatformIO/scripts/common-dependencies-post.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
Import("projenv") # src_dir environment. Only for post: scripts!
1010

1111
def apply_board_build_flags():
12-
if not "BOARD_CUSTOM_BUILD_FLAGS" in env["MARLIN_FEATURES"]:
12+
if "BOARD_CUSTOM_BUILD_FLAGS" not in env["MARLIN_FEATURES"]:
1313
return
1414
projenv.Append(CCFLAGS=env["MARLIN_FEATURES"]["BOARD_CUSTOM_BUILD_FLAGS"].split())
1515

buildroot/share/PlatformIO/scripts/common-dependencies.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ def add_to_feat_cnf(feature, flines):
7070
for dep in re.split(r',\s*', line):
7171
lib_name = (re.sub(r'@([~^]|[<>]=?)?[\d.]+', "", dep.strip()) .split("=") .pop(0))
7272
lib_re = re.compile("(?!^" + lib_name + "\\b)")
73-
if not "lib_deps" in feat: feat["lib_deps"] = {}
73+
if "lib_deps" not in feat: feat["lib_deps"] = {}
7474
feat["lib_deps"] = list(filter(lib_re.match, feat["lib_deps"])) + [dep]
7575
blab("[%s] lib_deps = %s" % (feature, dep), 3)
7676

7777
def load_features():
7878
blab("========== Gather [features] entries...")
7979
for key in ProjectConfig().items("features"):
8080
feature = key[0].upper()
81-
if not feature in FEATURE_CONFIG:
81+
if feature not in FEATURE_CONFIG:
8282
FEATURE_CONFIG[feature] = {"lib_deps": []}
8383
add_to_feat_cnf(feature, key[1])
8484

@@ -101,7 +101,7 @@ def get_all_known_libs():
101101
known_libs = []
102102
for feature in FEATURE_CONFIG:
103103
feat = FEATURE_CONFIG[feature]
104-
if not "lib_deps" in feat:
104+
if "lib_deps" not in feat:
105105
continue
106106
for dep in feat["lib_deps"]:
107107
known_libs.append(PackageSpec(dep).name)

buildroot/share/PlatformIO/scripts/configuration.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ def apply_config_ini(cp):
222222

223223
# For each ini_use_config item perform an action
224224
for ckey in config_keys:
225-
addbase = False
226225

227226
# For a key ending in .ini load and parse another .ini file
228227
if ckey.endswith(".ini"):

buildroot/share/PlatformIO/scripts/open_explorer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ def open_file_explorer():
88

99
env = DefaultEnvironment()
1010
BUILD_PATH = Path(env["PROJECT_BUILD_DIR"], env["PIOENV"])
11-
script = f"{BUILD_PATH}"
11+
script = str(BUILD_PATH)
1212
import platform
1313
current_OS = platform.system()
1414
if current_OS == "Windows":
15-
import os
1615
try:
16+
import os
1717
os.startfile(script)
1818
except OSError:
1919
try:

0 commit comments

Comments
 (0)