def parse_airodump(self, input):
    """
    Parses the airodump output
    If you find some error in the program flow, check this function first.
    returns ESSIDs, WPSstatus, channel, bssid and RSSI
    """

    plist = []
    input.reverse() # Important
    inds = [47,73,86] # CHANNEL, WPS, ESSID indexes
    if CHANNEL != '': inds = [i+4 for i in inds]
    for line in input:                              # Skip all the clients on the output
      if 'Probe' in line:                           #
	input = input[(input.index(line)+1):]       # Uses the 'Probe' keyword
	break                                       #                                      
    for i in input:
      if "][ Elapsed:" not in i and ":" in i and "<length:" not in i:
	i = i.lstrip().strip()
	snowden = i[inds[1]:] # I ran out of names
	try:
	  wps = snowden[0:snowden.index('  ')].strip()
	  essid = snowden[(snowden.index('  ')+2):].lstrip()
	except (IndexError, __HOLE__): # hence '  '
	  continue
	channel = i[inds[0]:inds[0]+2].lstrip()
	bssid = i[0:17]
	rssi = i[19:22]
	try:
	  if bssid not in blacklist and wps != '' and '0.0' not in wps and int(rssi) >= RSSI:
	    a = '%s|%s|%s|%s|%s|%s' %(bssid,channel.zfill(2),rssi,wps,wps,essid)
	    plist.append(a)
	except ValueError:
	  print ALERT + "There was a parsing error in parse_airodump function."
	except:
	  return plist
      elif "][ Elapsed:" in i:
	break
    plist.sort(key=lambda x: int(x[21:24]), reverse = True) # Sorts the list by RSSI
    if MAX_APS != 'All':
      try:
	return plist[0:MAX_APS]
      except IndexError:
	return plist
    if MAX_APS == 'All': # For the sake of readability
      return plist
dataset/ETHPy150Open jgilhutton/pyxiewps_WPShack-Python/pyxiewps-EN.py/Engine.parse_airodump