Skip to content

Commit 4903abb

Browse files
Testing nischal pushing to branch
1 parent 9ffe9e6 commit 4903abb

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

app/data/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
# Mapping of services to data-sources.
77
DATA_SOURCES = {"jhu": JhuLocationService(), "csbs": CSBSLocationService(), "nyt": NYTLocationService()}
8+
# DATA_SOURCES = {"jhu": JhuLocationService(), "csbs": CSBSLocationService()}
89

910

1011
def data_source(source):

app/services/location/nyt.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from asyncache import cached
66
from cachetools import TTLCache
77

8+
from ...utils import httputils
89
from . import LocationService
910

1011

@@ -38,4 +39,16 @@ async def get_category(category):
3839

3940
@cached(cache=TTLCache(maxsize=1024, ttl=3600))
4041
async 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+
'''

0 commit comments

Comments
 (0)