Skip to content

Commit

Permalink
Comment, dedent, comment, fstring
Browse files Browse the repository at this point in the history
  • Loading branch information
aBozowski committed May 27, 2022
1 parent 89ce50e commit 161e92b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions examples/chef/chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 161e92b

Please sign in to comment.