@@ -68,7 +68,7 @@ async def get_category(category):
6868
6969 # Request the data
7070 LOGGER .info (f"{ data_id } Requesting data..." )
71- async with httputils .CLIENT_SESSION .get (url ) as response :
71+ async with httputils .Session . getClientSession () .get (url ) as response :
7272 text = await response .text ()
7373
7474 LOGGER .debug (f"{ data_id } Data received" )
@@ -82,10 +82,12 @@ async def get_category(category):
8282
8383 for item in data :
8484 # Filter out all the dates.
85- dates = dict (filter (lambda element : date_util .is_date (element [0 ]), item .items ()))
85+ dates = dict (
86+ filter (lambda element : date_util .is_date (element [0 ]), item .items ()))
8687
8788 # Make location history from dates.
88- history = {date : int (float (amount or 0 )) for date , amount in dates .items ()}
89+ history = {date : int (float (amount or 0 ))
90+ for date , amount in dates .items ()}
8991
9092 # Country for this location.
9193 country = item ["Country/Region" ]
@@ -101,7 +103,7 @@ async def get_category(category):
101103 "country_code" : countries .country_code (country ),
102104 "province" : item ["Province/State" ],
103105 # Coordinates.
104- "coordinates" : {"lat" : item ["Lat" ], "long" : item ["Long" ],},
106+ "coordinates" : {"lat" : item ["Lat" ], "long" : item ["Long" ], },
105107 # History.
106108 "history" : history ,
107109 # Latest statistic.
@@ -178,7 +180,8 @@ async def get_locations():
178180 location ["country" ],
179181 location ["province" ],
180182 # Coordinates.
181- Coordinates (latitude = coordinates ["lat" ], longitude = coordinates ["long" ]),
183+ Coordinates (
184+ latitude = coordinates ["lat" ], longitude = coordinates ["long" ]),
182185 # Last update.
183186 datetime .utcnow ().isoformat () + "Z" ,
184187 # Timelines (parse dates as ISO).
0 commit comments