Skip to content

Commit 2d0d8c3

Browse files
committed
Structural Pattern -- Composite
1 parent 04f3e58 commit 2d0d8c3

File tree

3 files changed

+11
-39
lines changed

3 files changed

+11
-39
lines changed

app/coordinates.py

Lines changed: 0 additions & 30 deletions
This file was deleted.

app/data/__init__.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
from ..services.location.csbs import CSBSLocationService
33
from ..services.location.jhu import JhuLocationService
44
from ..services.location.nyt import NYTLocationService
5+
from ..services.location.dataSource import dataSource
6+
57

68
# Mapping of services to data-sources.
79
DATA_SOURCES = {
@@ -10,12 +12,3 @@
1012
"nyt": NYTLocationService(),
1113
}
1214

13-
14-
def data_source(source):
15-
"""
16-
Retrieves the provided data-source service.
17-
18-
:returns: The service.
19-
:rtype: LocationService
20-
"""
21-
return DATA_SOURCES.get(source.lower())
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class dataSource(object):
2+
def data_source(source):
3+
"""
4+
Retrieves the provided data-source service.
5+
6+
:returns: The service.
7+
:rtype: LocationService
8+
"""
9+
return DATA_SOURCES.get(source.lower())

0 commit comments

Comments
 (0)