ref #56 fix error when «Found 0 frequences»
This commit is contained in:
parent
502ff322b7
commit
7be65562c7
1 changed files with 23 additions and 21 deletions
|
@ -58,11 +58,12 @@ def select_freqs(serverlist, count = 1):
|
|||
sorted_list = sorted(listcopy, key=lambda s:
|
||||
(operatorscount[(s.mcc,s.mnc)], s.mcc,
|
||||
s.mnc, -s.power))
|
||||
if 0 in sorted_list:
|
||||
s = sorted_list[0]
|
||||
freqs.append(s.freq)
|
||||
operatorscount[(s.mcc, s.mnc)] = operatorscount[(s.mcc, s.mnc)] + 1
|
||||
count = count - 1
|
||||
listcopy.remove(s)
|
||||
count = count - 1
|
||||
return freqs
|
||||
|
||||
def argument_parser():
|
||||
|
@ -79,6 +80,7 @@ def main(options = None):
|
|||
print("Locating potential GSM base station frequencies (this can take a few minutes).")
|
||||
list = find_gsm_bases()
|
||||
print("Found %d frequences" % len(list))
|
||||
if len(list) > 0:
|
||||
numreceivers = options.numrecv
|
||||
freqs = select_freqs(list, numreceivers)
|
||||
|
||||
|
|
Loading…
Reference in a new issue