diff options
-rw-r--r-- | library.py | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | #!/usr/bin/env python3 | 1 | #!/usr/bin/env python3 |
2 | import datetime, requests, json, pytz | 2 | import datetime, requests, json, pytz, sys |
3 | from geopy.geocoders import Nominatim, GeoNames | 3 | from geopy.geocoders import Nominatim, GeoNames |
4 | 4 | ||
5 | def get_lat_long(location): | 5 | def get_lat_long(location): |
@@ -72,9 +72,9 @@ def fill_gaps(values): | |||
72 | ret.append(val) | 72 | ret.append(val) |
73 | duration_hours = int((val["duration"].seconds / 3600) + (val["duration"].days * 24)) | 73 | duration_hours = int((val["duration"].seconds / 3600) + (val["duration"].days * 24)) |
74 | if duration_hours > 1: | 74 | if duration_hours > 1: |
75 | for _ in range(0, duration_hours - 1): | 75 | for i in range(1, duration_hours): |
76 | copy = val.copy() | 76 | copy = val.copy() |
77 | copy["time"] = val["time"] + datetime.timedelta(hours=1) | 77 | copy["time"] = val["time"] + datetime.timedelta(hours=i) |
78 | copy["duration"] = datetime.timedelta(hours=1) | 78 | copy["duration"] = datetime.timedelta(hours=1) |
79 | ret.append(copy) | 79 | ret.append(copy) |
80 | return ret | 80 | return ret |
@@ -347,5 +347,3 @@ def get_hourly_data(raw_data, end_time): | |||
347 | i+=1 | 347 | i+=1 |
348 | 348 | ||
349 | return ret | 349 | return ret |
350 | |||
351 | |||