Skip to content

Commit

Permalink
Restyle
Browse files Browse the repository at this point in the history
  • Loading branch information
aBozowski committed May 27, 2022
1 parent 4ff29bb commit ecd2d00
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions examples/chef/chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ def load_config() -> None:
configStream.close()
else:
flush_print("Running for the first time and configuring config.yaml. " +
"Change this configuration file to include correct configuration " +
"for the vendor's SDK")
"Change this configuration file to include correct configuration " +
"for the vendor's SDK")
configStream = open(configFile, 'w')
config["nrfconnect"]["ZEPHYR_BASE"] = os.environ.get('ZEPHYR_BASE')
config["nrfconnect"]["TTY"] = None
Expand All @@ -94,7 +94,7 @@ def load_config() -> None:
def check_python_version() -> None:
if sys.version_info[0] < 3:
flush_print('Must use Python 3. Current version is ' +
str(sys.version_info[0]))
str(sys.version_info[0]))
exit(1)


Expand All @@ -109,8 +109,8 @@ def check_zap_master() -> str:


def generate_device_manifest(
include_zap_submod: bool = False,
write_manifest_file: bool = False) -> Dict[str, Any]:
include_zap_submod: bool = False,
write_manifest_file: bool = False) -> Dict[str, Any]:
"""Produces dictionary containing md5 of device dir zap files.
Args:
Expand Down Expand Up @@ -352,8 +352,8 @@ def main(argv: Sequence[str]) -> None:
if options.build_target == "nrfconnect":
os.environ['GNUARMEMB_TOOLCHAIN_PATH'] = os.environ['PW_ARM_CIPD_INSTALL_DIR']
for device_name in [d for d in _DEVICE_LIST if d in _CI_ALLOW_LIST]:
command = f"./chef.py -cbr --use_zzz -d {device_name} -t {options.build_target}"
subprocess.check_call(command, cwd=_CHEF_SCRIPT_PATH, shell=True)
command = f"./chef.py -cbr --use_zzz -d {device_name} -t {options.build_target}"
subprocess.check_call(command, cwd=_CHEF_SCRIPT_PATH, shell=True)
exit(0)

#
Expand Down Expand Up @@ -604,7 +604,8 @@ def main(argv: Sequence[str]) -> None:
shell.run_cmd(f"screen {config['nrfconnect']['TTY']} 115200")
elif (options.build_target == "silabs-thread"):
if config['silabs-thread']['TTY'] is None:
flush_print('The path for the serial enumeration for silabs-thread is not set. Make sure silabs-thread.TTY is set on your config.yaml file')
flush_print(
'The path for the serial enumeration for silabs-thread is not set. Make sure silabs-thread.TTY is set on your config.yaml file')
exit(1)

shell.run_cmd("killall screen")
Expand All @@ -625,12 +626,14 @@ def main(argv: Sequence[str]) -> None:
elif (options.build_target == "silabs-thread"):
if (sys.platform == "linux") or (sys.platform == "linux2"):
if(config['silabs-thread']['TTY'] is None):
flush_print('The path for the serial enumeration for silabs-thread is not set. Make sure silabs-thread.TTY is set on your config.yaml file')
flush_print(
'The path for the serial enumeration for silabs-thread is not set. Make sure silabs-thread.TTY is set on your config.yaml file')
exit(1)
shell.run_cmd(f"python3 -m chip_rpc.console --device {config['silabs-thread']['TTY']} -b 115200")
elif sys.platform == "darwin":
if(config['silabs-thread']['CU'] is None):
flush_print('The path for the serial enumeration for silabs-thread is not set. Make sure silabs-thread.CU is set on your config.yaml file')
flush_print(
'The path for the serial enumeration for silabs-thread is not set. Make sure silabs-thread.CU is set on your config.yaml file')
exit(1)
shell.run_cmd(f"python3 -m chip_rpc.console --device {config['silabs-thread']['CU']} -b 115200")

Expand Down

0 comments on commit ecd2d00

Please sign in to comment.