def __init__(self, protocol, host, port, uri, session_token=None, get_new_token=None): """ @param get_new_token: a function which can generate a new token. """ super().__init__(protocol, host, port, uri, session_token, get_new_token) self.client = codeCheckerProductService.Client(self.protocol)
def __init__(self, protocol, host, port, uri, session_token=None): self.__host = host self.__port = port url = create_product_url(protocol, host, port, uri) self.transport = THttpClient.THttpClient(url) self.protocol = TJSONProtocol.TJSONProtocol(self.transport) self.client = codeCheckerProductService.Client(self.protocol) if session_token: headers = {'Cookie': SESSION_COOKIE_NAME + '=' + session_token} self.transport.setCustomHeaders(headers)
def __init__(self, proto, host, port, product, uri, auto_handle_connection=True, session_token=None): # Import only if necessary; some tests may not add this to PYTHONPATH. from codechecker_api.ProductManagement_v6 \ import codeCheckerProductService from codechecker_client.credential_manager import SESSION_COOKIE_NAME full_uri = '/v' + VERSION + uri if product: full_uri = '/' + product + full_uri url = create_product_url(proto, host, port, full_uri) transport = THttpClient.THttpClient(url) protocol = TJSONProtocol.TJSONProtocol(transport) client = codeCheckerProductService.Client(protocol) if session_token: headers = {'Cookie': SESSION_COOKIE_NAME + '=' + session_token} transport.setCustomHeaders(headers) super(CCProductHelper, self).__init__(transport, client, auto_handle_connection)