diff --git a/README.md b/README.md index c53652a..daf2caa 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# (S)pothole +#  **Work in progress.** diff --git a/core/constants.py b/core/constants.py index 843d772..bed3313 100644 --- a/core/constants.py +++ b/core/constants.py @@ -4,9 +4,6 @@ from data.band import Band SOFTWARE_NAME = "(S)pothole by M0TRT" SOFTWARE_VERSION = "0.1" -# Sources -SOURCES = ["POTA", "SOTA", "WWFF", "GMA", "WWBOTA", "HEMA", "ParksNPeaks", "Cluster", "RBN", "APRS-IS"] - # Special Interest Groups SIGS = ["POTA", "SOTA", "WWFF", "GMA", "WWBOTA", "HEMA", "MOTA", "ARLHS", "SiOTA", "WCA"] diff --git a/data/spot.py b/data/spot.py index 944c2ce..8c3a289 100644 --- a/data/spot.py +++ b/data/spot.py @@ -182,10 +182,11 @@ class Spot: # Last resort for getting a position, use the DXCC entity. if self.dx_call and not self.latitude: latlon = infer_latlon_from_callsign_dxcc(self.dx_call) - self.latitude = latlon[0] - self.longitude = latlon[1] - self.grid = infer_grid_from_callsign_dxcc(self.dx_call) - self.location_source = "DXCC" + if latlon: + self.latitude = latlon[0] + self.longitude = latlon[1] + self.grid = infer_grid_from_callsign_dxcc(self.dx_call) + self.location_source = "DXCC" # Location is "good" if it is from a spot, or from QRZ if the callsign doesn't contain a slash, so the operator # is likely at home. diff --git a/server/webserver.py b/server/webserver.py index 49cb9cd..ef91567 100644 --- a/server/webserver.py +++ b/server/webserver.py @@ -8,7 +8,7 @@ import pytz from bottle import run, response, template from core.config import MAX_SPOT_AGE -from core.constants import BANDS, ALL_MODES, MODE_TYPES, SIGS, SOURCES, CONTINENTS +from core.constants import BANDS, ALL_MODES, MODE_TYPES, SIGS, CONTINENTS from core.utils import serialize_everything @@ -125,6 +125,7 @@ class WebServer: "modes": ALL_MODES, "mode_types": MODE_TYPES, "sigs": SIGS, - "sources": SOURCES, + # Sources are filtered for only ones that are enabled in config, no point letting the user toggle things that aren't even available. + "sources": list(map(lambda p: p["name"], filter(lambda p: p["enabled"], self.status_data["providers"]))), "continents": CONTINENTS, "max_spot_age": MAX_SPOT_AGE} diff --git a/views/webpage_home.tpl b/views/webpage_home.tpl index 41a936d..507c5c9 100644 --- a/views/webpage_home.tpl +++ b/views/webpage_home.tpl @@ -7,8 +7,8 @@
- - + +