Skip to content

Commit df805dd

Browse files
committed
Testing Singleton
1 parent 7236538 commit df805dd

File tree

6 files changed

+468
-394
lines changed

6 files changed

+468
-394
lines changed

app/coordinates.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,19 @@
11
"""app.coordinates.py"""
2-
3-
42
class Coordinates:
53
"""
64
A position on earth using decimal coordinates (latitude and longitude).
75
"""
8-
96
def __init__(self, latitude, longitude):
107
self.latitude = latitude
118
self.longitude = longitude
129

13-
class Serialize:
14-
def serialize(self,latitude,longitude):
10+
def serialize(self):
1511
"""
1612
Serializes the coordinates into a dict.
17-
1813
:returns: The serialized coordinates.
1914
:rtype: dict
2015
"""
21-
22-
return {cord}
16+
return {"latitude": self.latitude, "longitude": self.longitude}
2317

2418
def __str__(self):
25-
return "lat: %s, long: %s" % (cord)
26-
27-
cord = Coordinates("latitude","longitude")
19+
return "lat: %s, long: %s" % (self.latitude, self.longitude)

app/data/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
def data_source(source):
1515
"""
1616
Retrieves the provided data-source service.
17-
1817
:returns: The service.
1918
:rtype: LocationService
2019
"""

app/location/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""app.location"""
22
from ..coordinates import Coordinates
3-
from ..utils import countries
3+
from ..location import country
44
from ..utils.populations import country_population
55

66

0 commit comments

Comments
 (0)