Skip to content

Commit ddd6a06

Browse files
committed
Add line-by-line commentary when setting -o arg to curl
1 parent c3a8fe1 commit ddd6a06

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ttn_storage_api.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ def sensor_pull_storage(appname, accesskey, timestring, *,data_folder = None, tt
8282
tFolder = pathlib.Path(data_folder)
8383
if not tFolder.is_dir():
8484
raise FetchError(f"data_folder={data_folder}", f"not a directory")
85+
# Update the arguments to curl.
86+
# list1 += list2 syntax means "append each element of list2 to list 1"
87+
# pathlib.Path with two args constructs path from elements
88+
# curl ... -o outputs to a file, not to stdout.
89+
# We need to turn the result back to a string explicitly, so we
90+
# can append to args.
8591
args += [ "-o", str(pathlib.Path(tFolder, "sensors_lastperiod.json")) ]
8692

8793
# run the curl command to get the data.

0 commit comments

Comments
 (0)