diff --git a/app/coordinates.py b/app/coordinates.py deleted file mode 100644 index be972c6e..00000000 --- a/app/coordinates.py +++ /dev/null @@ -1,23 +0,0 @@ -"""app.coordinates.py""" - - -class Coordinates: - """ - A position on earth using decimal coordinates (latitude and longitude). - """ - - def __init__(self, latitude, longitude): - self.latitude = latitude - self.longitude = longitude - - def serialize(self): - """ - Serializes the coordinates into a dict. - - :returns: The serialized coordinates. - :rtype: dict - """ - return {"latitude": self.latitude, "longitude": self.longitude} - - def __str__(self): - return "lat: %s, long: %s" % (self.latitude, self.longitude) diff --git a/app/data/__init__.py b/app/data/__init__.py index 60a75dac..5d9cadc3 100644 --- a/app/data/__init__.py +++ b/app/data/__init__.py @@ -2,6 +2,8 @@ from ..services.location.csbs import CSBSLocationService from ..services.location.jhu import JhuLocationService from ..services.location.nyt import NYTLocationService +from ..services.location.dataSource import dataSource + # Mapping of services to data-sources. DATA_SOURCES = { @@ -10,12 +12,3 @@ "nyt": NYTLocationService(), } - -def data_source(source): - """ - Retrieves the provided data-source service. - - :returns: The service. - :rtype: LocationService - """ - return DATA_SOURCES.get(source.lower()) diff --git a/app/services/location/dataSource.py b/app/services/location/dataSource.py new file mode 100644 index 00000000..02dfb552 --- /dev/null +++ b/app/services/location/dataSource.py @@ -0,0 +1,9 @@ +class dataSource(object): + def data_source(source): + """ + Retrieves the provided data-source service. + + :returns: The service. + :rtype: LocationService + """ + return DATA_SOURCES.get(source.lower()) \ No newline at end of file