Pretty print JSON cache
Signed-off-by: Markus Birth <markus@birth-online.de>
This commit is contained in:
@@ -73,7 +73,7 @@ class ClearSky():
|
||||
else:
|
||||
r = requests.get(url).json()
|
||||
with open(cachefile, "wt") as f:
|
||||
json.dump(r, f)
|
||||
json.dump(r, f, indent=2)
|
||||
sleep(0.20) # Poor man's way of making sure to not go over 5 requests per second
|
||||
data_len = len(r["data"][data_key]) if data_key else len(r["data"])
|
||||
result += r["data"][data_key] if data_key else r["data"]
|
||||
|
||||
Reference in New Issue
Block a user