🎨 Python ; cleanup (#26426)
This commit is contained in:
@@ -9,7 +9,7 @@ if pioutil.is_pio_build():
|
||||
board = marlin.env.BoardConfig()
|
||||
|
||||
def calculate_crc(contents, seed):
|
||||
accumulating_xor_value = seed;
|
||||
accumulating_xor_value = seed
|
||||
|
||||
for i in range(0, len(contents), 4):
|
||||
value = struct.unpack('<I', contents[ i : i + 4])[0]
|
||||
@@ -68,7 +68,7 @@ if pioutil.is_pio_build():
|
||||
uid_value = uuid.uuid4()
|
||||
file_key = int(uid_value.hex[0:8], 16)
|
||||
|
||||
xor_crc = 0xEF3D4323;
|
||||
xor_crc = 0xEF3D4323
|
||||
|
||||
# the input file is exepcted to be in chunks of 0x800
|
||||
# so round the size
|
||||
@@ -123,4 +123,4 @@ if pioutil.is_pio_build():
|
||||
fwpath.unlink()
|
||||
|
||||
marlin.relocate_firmware("0x08008800")
|
||||
marlin.add_post_action(encrypt);
|
||||
marlin.add_post_action(encrypt)
|
||||
|
@@ -194,7 +194,7 @@ def apply_config_ini(cp):
|
||||
cp2 = configparser.ConfigParser()
|
||||
cp2.read(config_path(ckey))
|
||||
apply_sections(cp2, sect)
|
||||
ckey = 'base';
|
||||
ckey = 'base'
|
||||
|
||||
# (Allow 'example/' as a shortcut for 'examples/')
|
||||
elif ckey.startswith('example/'):
|
||||
|
@@ -23,7 +23,7 @@ if pioutil.is_pio_build():
|
||||
|
||||
assert isfile(original_file) and isfile(src_file)
|
||||
shutil.copyfile(original_file, backup_file)
|
||||
shutil.copyfile(src_file, original_file);
|
||||
shutil.copyfile(src_file, original_file)
|
||||
|
||||
def _touch(path):
|
||||
with open(path, "w") as fp:
|
||||
|
@@ -32,4 +32,4 @@ if pioutil.is_pio_build():
|
||||
fw_path.rename(fws_path)
|
||||
|
||||
import marlin
|
||||
marlin.add_post_action(addboot);
|
||||
marlin.add_post_action(addboot)
|
||||
|
@@ -70,4 +70,4 @@ def encrypt_mks(source, target, env, new_name):
|
||||
fwpath.unlink()
|
||||
|
||||
def add_post_action(action):
|
||||
env.AddPostAction(str(Path("$BUILD_DIR", "${PROGNAME}.bin")), action);
|
||||
env.AddPostAction(str(Path("$BUILD_DIR", "${PROGNAME}.bin")), action)
|
||||
|
@@ -90,7 +90,7 @@ if pioutil.is_pio_build():
|
||||
# Find the name.cpp.o or name.o and remove it
|
||||
#
|
||||
def rm_ofile(subdir, name):
|
||||
build_dir = Path(env['PROJECT_BUILD_DIR'], build_env);
|
||||
build_dir = Path(env['PROJECT_BUILD_DIR'], build_env)
|
||||
for outdir in (build_dir, build_dir / "debug"):
|
||||
for ext in (".cpp.o", ".o"):
|
||||
fpath = outdir / "src/src" / subdir / (name + ext)
|
||||
|
Reference in New Issue
Block a user