Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions kano/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def getCellEncryption(s):
return s.strip().split(":")[1]

def getCellSignal(s):
s = s.split("Signal level=")[1]
s = re.split('Signal level(=|:)', s)[2]
return s.strip().split(" ")[0]

def getCellNoise(s):
Expand All @@ -142,7 +142,7 @@ def getCellNoise(s):
return 0

def getCellQuality(s):
s = s.split("=")[1]
s = re.split('(=|:)', s)[2]
return s.strip().split(" ")[0]

def getCellMAC(s):
Expand Down Expand Up @@ -177,7 +177,7 @@ def getCellMode(s):
if s.strip().startswith("Frequency:"):
cellData["Frequency"] = getCellFrequency(s)
cellData["Channel"] = getCellChannel(s)
if s.strip().startswith("Quality="):
if s.strip().startswith("Quality"):
cellData["Quality"] = getCellQuality(s)
cellData["Signal"] = getCellSignal(s)
cellData["Noise"] = getCellNoise(s)
Expand Down Expand Up @@ -233,8 +233,11 @@ def getList(self, unsecure=False, first=False, debug=False):
'''

def sortNetworks(adict):
x, z = adict['quality'].split('/')
factor = int(x) / float(z)
if '/' in adict['quality']:
x, z = adict['quality'].split('/')
factor = int(x) / float(z)
else:
factor = float(int(adict['quality'])) / 100
return factor

def add_wnet(wlist, new_wnet):
Expand Down