Added distances to bookmark descriptions.
This commit is contained in:
parent
90d3381529
commit
4cb1b38822
|
|
@ -84,10 +84,14 @@ class EIBI(object):
|
|||
)]
|
||||
# Describe transmitter locations
|
||||
if "src" in b and b["src"] in EIBI_Locations:
|
||||
pm = Config.get()
|
||||
rxPos = (pm["receiver_gps"]["lat"], pm["receiver_gps"]["lon"])
|
||||
description += [(
|
||||
"Transmitting from " +
|
||||
", ".join([x["name"] for x in EIBI_Locations[b["src"]]]) +
|
||||
"."
|
||||
", ".join([
|
||||
"{0} ({1}km)".format(x["name"], EIBI.distKm(rxPos, (x["lat"], x["lon"])))
|
||||
for x in EIBI_Locations[b["src"]]
|
||||
]) + "."
|
||||
)]
|
||||
# Done
|
||||
return " ".join(description)
|
||||
|
|
|
|||
|
|
@ -75,7 +75,12 @@ class Repeaters(object):
|
|||
description = []
|
||||
# Add information from the entry to the description
|
||||
if "status" in entry:
|
||||
description += [entry["status"] + "."]
|
||||
pm = Config.get()
|
||||
rxPos = (pm["receiver_gps"]["lat"], pm["receiver_gps"]["lon"])
|
||||
description += ["{0}, {1}km away.".format(
|
||||
entry["status"],
|
||||
Repeaters.distKm(rxPos, (entry["lat"], entry["lon"]))
|
||||
)]
|
||||
if "updated" in entry:
|
||||
description += ["Last updated " + entry["updated"] + "."]
|
||||
if "comment" in entry:
|
||||
|
|
|
|||
Loading…
Reference in New Issue