File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 55
66# Mapping of services to data-sources.
77DATA_SOURCES = {"jhu" : JhuLocationService (), "csbs" : CSBSLocationService (), "nyt" : NYTLocationService ()}
8+ # DATA_SOURCES = {"jhu": JhuLocationService(), "csbs": CSBSLocationService()}
89
910
1011def data_source (source ):
Original file line number Diff line number Diff line change 55from asyncache import cached
66from cachetools import TTLCache
77
8+ from ...utils import httputils
89from . import LocationService
910
1011
@@ -38,4 +39,16 @@ async def get_category(category):
3839
3940@cached (cache = TTLCache (maxsize = 1024 , ttl = 3600 ))
4041async def get_locations ():
42+ """
43+ Retrieves the locations from the categories. The locations are cached for 1 hour.
44+
45+ :returns: The locations.
46+ :rtype: List[Location]
47+ """
4148 pass
49+ '''
50+ async with httputils.CLIENT_SESSION.get(BASE_URL) as response:
51+ text = await response.text()
52+
53+ data = list(csv.DictReader(text.splitlines()))
54+ '''
You can’t perform that action at this time.
0 commit comments