~dobey/ubuntuone-storage-protocol/validate-ssl-cert

« back to all changes in this revision

Viewing changes to ubuntuone/storageprotocol/request.py

  • Committer: Tarmac
  • Author(s): Guillermo Gonzalez
  • Date: 2011-06-03 18:16:02 UTC
  • mfrom: (134.1.2 slotted)
  • Revision ID: tarmac-20110603181602-a98y5w60qddwogc0
Use __slots__ in Request and RequestResponse classes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
282
282
    """
283
283
    implements(IPushProducer)
284
284
 
 
285
    __slots__ = ('protocol', 'id', 'deferred', 'producer', 'started',
 
286
                 'finished', 'cancelled', 'producing')
 
287
 
285
288
    def __init__(self, protocol):
286
289
        """created a request.
287
290
 
449
452
 
450
453
    @ivar source_message: the message the generated this request.
451
454
    """
 
455
 
 
456
    __slots__ = ('source_message',)
 
457
 
452
458
    # pylint: disable=W0223
453
459
    def __init__(self, protocol, message):
454
460
        """Create a request response.
470
476
 
471
477
    @ivar rtt: will contain the round trip time when completed.
472
478
    """
 
479
 
 
480
    __slots__ = ('_start_time', 'rtt')
 
481
 
473
482
    def _start(self):
474
483
        """start the request sending a ping message."""
475
484
        # pylint: disable=W0201
 
485
        self.rtt = 0
476
486
        self._start_time = time.time()
477
487
        message = protocol_pb2.Message()
478
488
        message.id = self.id