Exemplo n.º 1
0
    def process(self, chain, parsing, request: Request,
                requestCnt: RequestContent, response: Response, **keyargs):
        '''
        @see: HandlerBranching.process
        
        Parse the request content.
        '''
        assert isinstance(chain, Chain), 'Invalid processors chain %s' % chain
        assert isinstance(parsing,
                          Processing), 'Invalid processing %s' % parsing
        assert isinstance(request, Request), 'Invalid request %s' % request
        assert isinstance(response, Response), 'Invalid response %s' % response

        chain.proceed()

        if response.isSuccess is False:
            return  # Skip in case the response is in error
        if request.decoder is None: return  # Skip if there is no decoder.

        if self.processParsing(parsing,
                               request=request,
                               requestCnt=requestCnt,
                               response=response,
                               **keyargs):
            # We process the chain without the request content anymore
            chain.arg.requestCnt = None
Exemplo n.º 2
0
    def process(self, chain, parsing, request:Request, requestCnt:RequestContent, response:Response, **keyargs):
        '''
        @see: HandlerBranching.process
        
        Parse the request content.
        '''
        assert isinstance(chain, Chain), 'Invalid processors chain %s' % chain
        assert isinstance(parsing, Processing), 'Invalid processing %s' % parsing
        assert isinstance(request, Request), 'Invalid request %s' % request
        assert isinstance(response, Response), 'Invalid response %s' % response

        chain.proceed()

        if response.isSuccess is False: return  # Skip in case the response is in error
        if request.decoder is None: return  # Skip if there is no decoder.

        if self.processParsing(parsing, request=request, requestCnt=requestCnt, response=response, **keyargs):
            # We process the chain without the request content anymore
            chain.arg.requestCnt = None
Exemplo n.º 3
0
 def wrapper(chain, **keyargs):
     assert isinstance(chain, Chain), 'Invalid processors chain %s' % chain
     call(**keyargs)
     chain.proceed()