59 lines
1.4 KiB
Python
59 lines
1.4 KiB
Python
delimiter = '\t'
|
|
#output_tags = False
|
|
#tag = "Untagged"
|
|
output_tags = True
|
|
output_outputs = True
|
|
output_inputs = True
|
|
tag = "RepeaterBook"
|
|
inputs_tag = "RepeaterBook Inputs"
|
|
|
|
d = []
|
|
inputs = []
|
|
f = open('repeaters.csv')
|
|
for line in f.readlines():
|
|
a = line.split(delimiter)
|
|
output = int(float(a[0]) * 1000000)
|
|
# Just assume MHZ. RepeaterBook proximity search 2.0 uses MHZ for all entries
|
|
#value, unit = a[1].strip().split()
|
|
offset = int(float(a[1].strip().split()[0]) * 1000000)
|
|
name = a[3] if a[3].strip() != '' else "NOCALL "
|
|
d.append([output, name])
|
|
inputs.append([output+offset, name])
|
|
|
|
lines = len(d)
|
|
print("# Total entries:", lines)
|
|
|
|
def srt_fn(element):
|
|
return element[0]
|
|
inputs.sort(key=srt_fn)
|
|
|
|
def remove_dupes(d):
|
|
last = d[0]
|
|
i = 1
|
|
while i < len(d):
|
|
if last[0] == d[i][0]:
|
|
if not last[1].strip() in d[i][1].split():
|
|
d[i][1] += last[1]
|
|
d.remove(last)
|
|
else:
|
|
i += 1
|
|
last = d[i-1]
|
|
remove_dupes(d)
|
|
remove_dupes(inputs)
|
|
|
|
print("# Overlapping outputs:", lines - len(d))
|
|
print("# Overlapping inputs:", lines - len(inputs))
|
|
|
|
if output_tags:
|
|
print(tag, "; #c0c0c0")
|
|
print(inputs_tag, "; #c0c0c0")
|
|
print("")
|
|
|
|
if output_outputs:
|
|
for freq, name in d:
|
|
print(freq, ';', name, ";\tNarrow FM ;\t10000 ;\t", tag)
|
|
|
|
if output_inputs:
|
|
for freq, name in inputs:
|
|
print(freq, ';', name+"input", ";\tNarrow FM ;\t10000 ;\t", inputs_tag)
|