Did I find the right examples for you? yes no

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)
HTTP/HTTPS client factory.

@param scantask: Object describing where the target is and how to reach it.
@type scantask: C{instanceof(ScanTask)}

@return: The appropriate client class for the specified URL.
@rtype: C{class}

        def clientFactory(scantask):
    """HTTP/HTTPS client factory.

    @param scantask: Object describing where the target is and how to reach it.
    @type scantask: C{instanceof(ScanTask)}

    @return: The appropriate client class for the specified URL.
    @rtype: C{class}
    """
    url = scantask.url
    keyfile = scantask.keyfile
    certfile = scantask.certfile

    if url.startswith('http://'):
        return HTTPClient()
    elif url.startswith('https://'):
        httpsclient = HTTPSClient()
        httpsclient.keyfile = keyfile
        httpsclient.certfile = certfile
        return httpsclient
    else:
        raise InvalidURL
        


src/h/a/halberd-0.2.4/Halberd/crew.py   halberd(Download)
    def process(self):
        """Gathers clues connecting directly to the target web server.
        """
        client = clientlib.clientFactory(self.task)
 

src/h/a/halberd-HEAD/Halberd/crew.py   halberd(Download)
    def process(self):
        """Gathers clues connecting directly to the target web server.
        """
        client = clientlib.clientFactory(self.task)