From 161e92b4c2c418137658c31c273306e2d94fde56 Mon Sep 17 00:00:00 2001 From: Austin Bozowski Date: Fri, 27 May 2022 18:25:21 +0000 Subject: [PATCH] Comment, dedent, comment, fstring --- examples/chef/chef.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/examples/chef/chef.py b/examples/chef/chef.py index f010fc3cc0bd14..1341a577cfde3a 100755 --- a/examples/chef/chef.py +++ b/examples/chef/chef.py @@ -262,15 +262,17 @@ def main(argv: Sequence[str]) -> None: print(f"Generating files in {_CHEF_ZZZ_ROOT} for all devices", flush=True) for device_dir_item in os.listdir(_CHEF_DEVICES_DIR): target_file_ext = ".zap" - if device_dir_item.endswith(target_file_ext): # and device_dir_item in chef_util.ci_allowlist: + if device_dir_item.endswith(target_file_ext): device_name = device_dir_item[:-len(target_file_ext)] print(f"Generating files for {device_name}", flush=True) device_out_dir = os.path.join(_CHEF_ZZZ_ROOT, device_name) os.mkdir(device_out_dir) device_out_dir = os.path.join(device_out_dir, "zap-generated") os.mkdir(device_out_dir) - shell.run_cmd(f"{_REPO_BASE_PATH}/scripts/tools/zap/generate.py\ - {_CHEF_SCRIPT_PATH}/devices/{device_name}.zap -o {device_out_dir}") + shell.run_cmd(textwrap.dedent(f"""\ + {_REPO_BASE_PATH}/scripts/tools/zap/generate.py \ + {_CHEF_SCRIPT_PATH}/devices/{device_name}.zap -o {device_out_dir} + """)) shell.run_cmd(f"touch {device_out_dir}/af-gen-event.h") chef_util.generate_device_manifest(_CHEF_DEVICES_DIR, include_zap_submod=True, write_manifest_file=True, ci_manifest_file_name=_CI_MANIFEST_FILE_NAME, repo_base_path=_REPO_BASE_PATH, chef_zzz_root=_CHEF_ZZZ_ROOT) @@ -310,11 +312,10 @@ def main(argv: Sequence[str]) -> None: if device.endswith(target_file_ext): device_name = device[:-len(target_file_ext)] for platform, platform_meta in cd_platforms_meta.items(): - # shutil.rmitem(configFile) directory = platform_meta['build_dir'] label = platform_meta['platform_label'] output_dir = os.path.join(_CHEF_SCRIPT_PATH, directory) - command = './chef.py -cbr --use_zzz -d {} -t {}'.format(device_name, platform) + command = f"./chef.py -cbr --use_zzz -d {device_name} -t {platform}" print('-' * 64, flush=True) print(f"Building {command}", flush=True) print('-' * 64, flush=True)