Skip to content

Commit

Permalink
update Python implementation to follow updated spec for comma-delimit…
Browse files Browse the repository at this point in the history
…ed --get
  • Loading branch information
ikluft committed May 13, 2024
1 parent 370a32a commit a73b3d5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/python/scripts/lon_tz.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,13 @@ def _do_lon_tz(args: dict) -> ErrStr | None:
# instantiate timezone_solar object and print requested field
tzs = TimeZoneSolar(**tzs_params)
try:
get_key = args["get"]
print(tzs.get(get_key))
get_keys = (','.join(args["get"])).split(sep=',')
for get_key in get_keys:
value = tzs.get(get_key)
if value is None:
print("")
else:
print(value)
except ValueError as tz_exc:
err = str(tz_exc)

Expand Down Expand Up @@ -212,7 +217,7 @@ def _gen_arg_parser() -> argparse.ArgumentParser:
# specify time zone field to display
top_parser.add_argument(
"--get",
action='store',
action='append',
help="specify solar time zone field to output",
)

Expand Down

0 comments on commit a73b3d5

Please sign in to comment.