diff --git a/providers/aprsis.py b/providers/aprsis.py index 1708659..ac2d48e 100644 --- a/providers/aprsis.py +++ b/providers/aprsis.py @@ -51,8 +51,7 @@ class APRSIS(Provider): latitude=data["latitude"] if "latitude" in data else None, longitude=data["longitude"] if "longitude" in data else None, time=datetime.now(pytz.UTC)) # APRS-IS spots are live so we can assume spot time is "now" - # Fill in any blanks - spot.infer_missing() + # Add to our list self.submit(spot) print(spot) diff --git a/providers/dxcluster.py b/providers/dxcluster.py index ae42d60..4dc945e 100644 --- a/providers/dxcluster.py +++ b/providers/dxcluster.py @@ -73,8 +73,7 @@ class DXCluster(Provider): freq=float(match.group(2)), comment=match.group(4).strip(), time=spot_datetime) - # Fill in any blanks - spot.infer_missing() + # Add to our list self.submit(spot) diff --git a/providers/gma.py b/providers/gma.py index b6e4425..ccf3260 100644 --- a/providers/gma.py +++ b/providers/gma.py @@ -46,8 +46,6 @@ class GMA(HTTPProvider): ref_info = ref_response.json() spot.sig = ref_info["reftype"] - # Fill in any missing data - spot.infer_missing() # Add to our list. Don't worry about de-duping, removing old spots etc. at this point; other code will do # that for us. new_spots.append(spot) diff --git a/providers/hema.py b/providers/hema.py index 81b482e..f8c02e8 100644 --- a/providers/hema.py +++ b/providers/hema.py @@ -61,8 +61,6 @@ class HEMA(HTTPProvider): latitude=float(spot_items[7]), longitude=float(spot_items[8])) - # Fill in any missing data - spot.infer_missing() # Add to our list. Don't worry about de-duping, removing old spots etc. at this point; other code will do # that for us. new_spots.append(spot) diff --git a/providers/parksnpeaks.py b/providers/parksnpeaks.py index d19f998..627b5f5 100644 --- a/providers/parksnpeaks.py +++ b/providers/parksnpeaks.py @@ -37,8 +37,6 @@ class ParksNPeaks(HTTPProvider): # If this is POTA, SOTA or WWFF data we already have it through other means, so ignore. if spot.sig not in ["POTA", "SOTA", "WWFF"]: logging.warn("PNP spot found with sig " + spot.sig + ", developer needs to figure out how to look this up for grid/lat/lon!") - # Fill in any missing data - spot.infer_missing() # Add to our list. Don't worry about de-duping, removing old spots etc. at this point; other code will do # that for us. new_spots.append(spot) diff --git a/providers/pota.py b/providers/pota.py index 5d74505..ba3dc68 100644 --- a/providers/pota.py +++ b/providers/pota.py @@ -36,8 +36,7 @@ class POTA(HTTPProvider): grid=source_spot["grid6"], latitude=source_spot["latitude"], longitude=source_spot["longitude"]) - # Fill in any missing data - spot.infer_missing() + # Add to our list. Don't worry about de-duping, removing old spots etc. at this point; other code will do # that for us. new_spots.append(spot) diff --git a/providers/provider.py b/providers/provider.py index 9c3a757..29a9415 100644 --- a/providers/provider.py +++ b/providers/provider.py @@ -32,17 +32,25 @@ class Provider: raise NotImplementedError("Subclasses must implement this method") # Submit a batch of spots retrieved from the provider. Only spots that are newer than the last spot retrieved - # by this provider will be added to the spot list, to prevent duplications. This is called by the API-querying + # by this provider will be added to the spot list, to prevent duplications. Spots passing the check will also have + # their infer_missing() method called to complete their data set. This is called by the API-querying # subclasses on receiving spots. def submit_batch(self, spots): for spot in spots: if spot.time > self.last_spot_time: + # Fill in any blanks + spot.infer_missing() + # Append to the list self.spot_list.append(spot) self.last_spot_time = max(map(lambda s: s.time, spots)) - # Submit a single spot retrieved from the provider. This will be added to the list regardless of its age. This is - # called by the data streaming subclasses, which can be relied upon not to re-provide old spots. + # Submit a single spot retrieved from the provider. This will be added to the list regardless of its age. Spots + # passing the check will also have their infer_missing() method called to complete their data set. This is called by + # the data streaming subclasses, which can be relied upon not to re-provide old spots. def submit(self, spot): + # Fill in any blanks + spot.infer_missing() + # Append to the list self.spot_list.append(spot) self.last_spot_time = spot.time diff --git a/providers/rbn.py b/providers/rbn.py index 0e8ab96..671eb01 100644 --- a/providers/rbn.py +++ b/providers/rbn.py @@ -74,8 +74,7 @@ class RBN(Provider): freq=float(match.group(2)), comment=match.group(4).strip(), time=spot_datetime) - # Fill in any blanks - spot.infer_missing() + # Add to our list self.submit(spot) diff --git a/providers/sota.py b/providers/sota.py index aa37a8d..45580c5 100644 --- a/providers/sota.py +++ b/providers/sota.py @@ -60,8 +60,6 @@ class SOTA(HTTPProvider): spot.latitude = summit_data["latitude"] spot.longitude = summit_data["longitude"] - # Fill in any missing data - spot.infer_missing() # Add to our list. Don't worry about de-duping, removing old spots etc. at this point; other code will do # that for us. new_spots.append(spot) diff --git a/providers/wwbota.py b/providers/wwbota.py index d788aa3..b5ed89d 100644 --- a/providers/wwbota.py +++ b/providers/wwbota.py @@ -42,8 +42,7 @@ class WWBOTA(HTTPProvider): latitude=source_spot["references"][0]["lat"], longitude=source_spot["references"][0]["long"], qrt=source_spot["type"] == "QRT") - # Fill in any missing data - spot.infer_missing() + # Add to our list. Don't worry about de-duping, removing old spots etc. at this point; other code will do # that for us. But WWBOTA does support a special "Test" spot type, we need to avoid adding that. if source_spot["type"] != "Test": diff --git a/providers/wwff.py b/providers/wwff.py index bfcdf98..ca40158 100644 --- a/providers/wwff.py +++ b/providers/wwff.py @@ -35,8 +35,7 @@ class WWFF(HTTPProvider): time=datetime.fromtimestamp(source_spot["spot_time"]).replace(tzinfo=pytz.UTC), latitude=source_spot["latitude"], longitude=source_spot["longitude"]) - # Fill in any missing data - spot.infer_missing() + # Add to our list. Don't worry about de-duping, removing old spots etc. at this point; other code will do # that for us. new_spots.append(spot)