'Fetch the requested URL from an ELF line'

def GetELFLine(self, line):

    fields = line.split('    ')
    count = len(fields)
    if (self._elf_status >= 0):
        if (self._elf_status >= count):
            return None
        if (not (fields[self._elf_status].strip() == '200')):
            return None
    if (self._elf_method >= 0):
        if (self._elf_method >= count):
            return None
        if (not (fields[self._elf_method].strip() in ('HEAD', 'GET'))):
            return None
    if (self._elf_uri >= 0):
        if (self._elf_uri >= count):
            return None
        url = fields[self._elf_uri].strip()
        if (url != '-'):
            return url
    if (self._elf_urifrag1 >= 0):
        if ((self._elf_urifrag1 >= count) or (self._elf_urifrag2 >= count)):
            return None
        urlfrag1 = fields[self._elf_urifrag1].strip()
        urlfrag2 = None
        if (self._elf_urifrag2 >= 0):
            urlfrag2 = fields[self._elf_urifrag2]
        if (urlfrag1 and (urlfrag1 != '-')):
            if (urlfrag2 and (urlfrag2 != '-')):
                urlfrag1 = ((urlfrag1 + '?') + urlfrag2)
            return urlfrag1
    return None
