Skip to content
Prev Previous commit
Next Next commit
Testing Singleton
  • Loading branch information
Solracion committed Aug 12, 2021
commit df805dde6ae8d2ace3dfedd3175fece07473aa2e
14 changes: 3 additions & 11 deletions app/coordinates.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
"""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

class Serialize:
def serialize(self,latitude,longitude):
def serialize(self):
"""
Serializes the coordinates into a dict.

:returns: The serialized coordinates.
:rtype: dict
"""

return {cord}
return {"latitude": self.latitude, "longitude": self.longitude}

def __str__(self):
return "lat: %s, long: %s" % (cord)

cord = Coordinates("latitude","longitude")
return "lat: %s, long: %s" % (self.latitude, self.longitude)
1 change: 0 additions & 1 deletion app/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
def data_source(source):
"""
Retrieves the provided data-source service.

:returns: The service.
:rtype: LocationService
"""
Expand Down
2 changes: 1 addition & 1 deletion app/location/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""app.location"""
from ..coordinates import Coordinates
from ..utils import countries
from ..location import country
from ..utils.populations import country_population


Expand Down
Loading