diff --git a/kano/network.py b/kano/network.py index 00f9cd2..ff3e77a 100755 --- a/kano/network.py +++ b/kano/network.py @@ -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): @@ -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): @@ -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) @@ -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):