Changeset 1440

Show
Ignore:
Timestamp:
06/20/08 10:38:08 (7 months ago)
Author:
thijs
Message:

Cosmetic update

Location:
pyamf/trunk/pyamf/remoting
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pyamf/trunk/pyamf/remoting/__init__.py

    r1416 r1440  
    202202        return "<%s status=%s>%s</%s>" % ( 
    203203            type(self).__name__, _get_status(self.status), self.body, 
    204             type(self).__name__) 
     204            type(self).__name__ 
     205        ) 
    205206 
    206207class BaseFault(object): 
  • pyamf/trunk/pyamf/remoting/client/__init__.py

    r1427 r1440  
    4545        Inform the proxied service that this function has been called. 
    4646        """ 
     47         
    4748        return self.service._call(self, *args) 
    4849 
     
    231232            raise ValueError, 'Unknown scheme' 
    232233 
    233         self.logger.debug('creating connection to %s://%s:%s' % (self.url[0], hostname, port)) 
     234        self.logger.info('Creating connection to %s://%s:%s' % (self.url[0], hostname, port)) 
    234235 
    235236    def addHeader(self, name, value, must_understand=False): 
     
    274275        self.request_number += 1 
    275276        self.requests.append(wrapper) 
    276         self.logger.debug('adding request %s%r' % (wrapper.service, args)) 
     277        self.logger.debug('Adding request %s%r' % (wrapper.service, args)) 
    277278 
    278279        return wrapper 
     
    285286        """ 
    286287        if isinstance(service, RequestWrapper): 
     288            self.logger.debug('Removing request: %s' % (self.requests[self.requests.index(service)])) 
    287289            del self.requests[self.requests.index(service)] 
    288290 
     
    291293        for request in self.requests: 
    292294            if request.service == service and request.args == args: 
     295                self.logger.debug('Removing request: %s' % (self.requests[self.requests.index(request)])) 
    293296                del self.requests[self.requests.index(request)] 
    294297 
     
    307310        """ 
    308311        envelope = remoting.Envelope(self.amf_version, self.client_type) 
    309  
     312         
     313        self.logger.debug('AMF version: %s' % self.amf_version) 
     314        self.logger.debug('Client type: %s' % self.client_type) 
     315         
    310316        for request in requests: 
    311317            service = request.service 
     
    327333        @rtype: 
    328334        """ 
    329         self.logger.debug('executing single request') 
     335        self.logger.debug('Executing single request: %s' % request) 
    330336        body = remoting.encode(self.getAMFRequest([request])) 
    331337 
    332         self.logger.debug('sending POST request to %s' % self._root_url) 
     338        self.logger.debug('Sending POST request to %s' % self._root_url) 
    333339        self.connection.request('POST', self._root_url, body.getvalue(), 
    334340            {'Content-Type': remoting.CONTENT_TYPE}) 
     
    346352        body = remoting.encode(self.getAMFRequest(self.requests)) 
    347353 
     354        self.logger.debug('Sending POST request to %s' % self._root_url) 
    348355        self.connection.request('POST', self._root_url, body.getvalue(), 
    349356            {'Content-Type': remoting.CONTENT_TYPE}) 
     
    363370        Gets and handles the HTTP response from the remote gateway. 
    364371        """ 
    365         self.logger.debug('waiting for response ...') 
     372        self.logger.debug('Waiting for response...') 
    366373        http_response = self.connection.getresponse() 
    367         self.logger.debug('got response status=%s' % http_response.status) 
    368  
     374        self.logger.debug('Got response status = %s' % http_response.status) 
     375        self.logger.debug('Content-Type = %s' % http_response.getheader('Content-Type')) 
     376         
    369377        if http_response.status != HTTP_OK: 
    370             self.logger.debug('content-type = %s' % http_response.getheader('Content-Type')) 
    371             self.logger.debug('body = %s' % http_response.read()) 
     378            self.logger.debug('Body = %s' % http_response.read()) 
    372379 
    373380            if hasattr(httplib, 'responses'): 
     
    381388 
    382389        if content_type != remoting.CONTENT_TYPE: 
    383             self.logger.debug('content-type = %s' % http_response.getheader('Content-Type')) 
    384             self.logger.debug('body = %s' % http_response.read()) 
     390            self.logger.debug('Body = %s' % http_response.read()) 
    385391 
    386392            raise remoting.RemotingError, "Incorrect MIME type received. (got: %s)" % content_type 
     
    388394        content_length = http_response.getheader('Content-Length') 
    389395        bytes = '' 
     396 
     397        self.logger.debug('Content-Length = %s' % content_length) 
    390398 
    391399        if content_length is None: 
     
    394402            bytes = http_response.read(content_length) 
    395403 
    396         self.logger.debug('read %d bytes for the response' % len(bytes)) 
     404        self.logger.debug('Read %d bytes for the response' % len(bytes)) 
    397405 
    398406        response = remoting.decode(bytes) 
    399         self.logger.debug('response = %s' % response) 
     407        self.logger.debug('Response = %s' % response) 
    400408 
    401409        if remoting.APPEND_TO_GATEWAY_URL in response.headers: