'Parse one proxy string entry, as described in PAC specification.'

@staticmethod
def _parse_proxy_entry(proxy_str):

    config = [c.strip() for c in proxy_str.split('    ') if c]
    if (not config):
        raise ParseProxyError('Empty    proxy    entry')
    elif (config[0] == 'DIRECT'):
        if (len(config) != 1):
            raise ParseProxyError(('Invalid    number    of    parameters    for    ' + 'DIRECT'))
        return QNetworkProxy(QNetworkProxy.NoProxy)
    elif (config[0] == 'PROXY'):
        if (len(config) != 2):
            raise ParseProxyError('Invalid    number    of    parameters    for    PROXY')
        (host, port) = PACResolver._parse_proxy_host(config[1])
        return QNetworkProxy(QNetworkProxy.HttpProxy, host, port)
    elif (config[0] in ['SOCKS', 'SOCKS5']):
        if (len(config) != 2):
            raise ParseProxyError('Invalid    number    of    parameters    for    SOCKS')
        (host, port) = PACResolver._parse_proxy_host(config[1])
        return QNetworkProxy(QNetworkProxy.Socks5Proxy, host, port)
    else:
        err = 'Unknown    proxy    type:    {}'
        raise ParseProxyError(err.format(config[0]))
