Added better cli output
parent
8114498ca1
commit
56ff5d4cc3
|
@ -42,7 +42,15 @@ async def main():
|
||||||
args.club_id, config["DEFAULT"]["weather_api_key"], args.days
|
args.club_id, config["DEFAULT"]["weather_api_key"], args.days
|
||||||
)
|
)
|
||||||
|
|
||||||
print(res)
|
for field_name, start_time, duration, weather_names in res:
|
||||||
|
pruned_weather_names = sorted(set(weather_names),
|
||||||
|
key=lambda x: weather_names.index(x))
|
||||||
|
print("{} ({}, {}m): {}".format(
|
||||||
|
field_name,
|
||||||
|
start_time.strftime("%d:%m:%y %H:%M"),
|
||||||
|
int(duration.total_seconds() // 60),
|
||||||
|
" -> ".join(pruned_weather_names)
|
||||||
|
))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
@ -29,11 +29,9 @@ async def get_decent_timeslots(club_id, weather_api_key, days=1):
|
||||||
weather_forecasts = {
|
weather_forecasts = {
|
||||||
date_obj: weather_str for date_obj, weather_str, _ in weather_forecasts
|
date_obj: weather_str for date_obj, weather_str, _ in weather_forecasts
|
||||||
}
|
}
|
||||||
print(weather_forecasts)
|
|
||||||
|
|
||||||
# Filter out non-free timeslots
|
# Filter out non-free timeslots
|
||||||
timeslots = list(filter(lambda x: x[1] == 0, timeslots))
|
timeslots = list(filter(lambda x: x[1] == 0, timeslots))
|
||||||
print(timeslots)
|
|
||||||
|
|
||||||
output = []
|
output = []
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue