Skip to content

Commit 5f026df

Browse files
authored
changed data to implement LocationServiceFactory
1 parent ddfcb9e commit 5f026df

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

app/data/__init__.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
"""app.data"""
2-
from ..services.location.csbs import CSBSLocationService
3-
from ..services.location.jhu import JhuLocationService
4-
from ..services.location.nyt import NYTLocationService
2+
#from ..services.location.csbs import CSBSLocationService
3+
#from ..services.location.jhu import JhuLocationService
4+
#from ..services.location.nyt import NYTLocationService
5+
from ..services.location.locationFactory import LocationServiceFactory
56

67
# Mapping of services to data-sources.
78
"""
@@ -19,11 +20,14 @@ def data_source(source):
1920
:returns: The service.
2021
:rtype: LocationService
2122
"""
23+
24+
location = LocationServiceFactory()
25+
2226
if source.lower() = "csbs":
23-
return CSBSLocationService()
27+
return location.createCSBS()
2428
elif source.lower() = "nyt":
25-
return NYTLocationService()
29+
return location.createNYT()
2630
else:
27-
return JhuLocationService()
31+
return location.getDefault()
2832

2933
#return DATA_SOURCES.get(source.lower())

0 commit comments

Comments
 (0)