viff

changeset 598:79411fe0da54

Renamed variables to avoid clash with builtin type function.
author Martin Geisler <mg@daimi.au.dk>
date Sat, 22 Mar 2008 15:57:14 +0100
parents 5845aca82a6e
children 46bd23052806
files viff/runtime.py
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line diff
     1.1 --- a/viff/runtime.py	Sat Mar 22 15:56:05 2008 +0100
     1.2 +++ b/viff/runtime.py	Sat Mar 22 15:57:14 2008 +0100
     1.3 @@ -256,8 +256,8 @@
     1.4  
     1.5              self.factory.identify_peer(self)
     1.6          else:
     1.7 -            program_counter, type, data = marshal.loads(string)
     1.8 -            key = (program_counter, type)
     1.9 +            program_counter, data_type, data = marshal.loads(string)
    1.10 +            key = (program_counter, data_type)
    1.11  
    1.12              try:
    1.13                  deferred = self.incoming_data.pop(key)
    1.14 @@ -268,8 +268,8 @@
    1.15              # TODO: marshal.loads can raise EOFError, ValueError, and
    1.16              # TypeError. They should be handled somehow.
    1.17  
    1.18 -    def sendData(self, program_counter, type, data):
    1.19 -        send_data = (program_counter, type, data)
    1.20 +    def sendData(self, program_counter, data_type, data):
    1.21 +        send_data = (program_counter, data_type, data)
    1.22          self.sendString(marshal.dumps(send_data))
    1.23  
    1.24      def sendShare(self, program_counter, share):
    1.25 @@ -537,12 +537,12 @@
    1.26          result.addCallback(lambda _: None)
    1.27          return result
    1.28  
    1.29 -    def _expect_data(self, peer_id, type, deferred):
    1.30 +    def _expect_data(self, peer_id, data_type, deferred):
    1.31          assert peer_id != self.id, "Do not expect data from yourself!"
    1.32          # Convert self.program_counter to a hashable value in order to
    1.33          # use it as a key in self.protocols[peer_id].incoming_data.
    1.34          pc = tuple(self.program_counter)
    1.35 -        key = (pc, type)
    1.36 +        key = (pc, data_type)
    1.37  
    1.38          data = self.protocols[peer_id].incoming_data.pop(key, None)
    1.39          if data is None:
    1.40 @@ -922,12 +922,12 @@
    1.41          self._bracha_sent_ready[pc] = {}
    1.42          self._bracha_delivered[pc] = {}
    1.43  
    1.44 -        def unsafe_broadcast(type, message):
    1.45 +        def unsafe_broadcast(data_type, message):
    1.46              # Performs a regular broadcast without any guarantees. In
    1.47              # other words, it sends the message to each player except
    1.48              # for this one.
    1.49              for protocol in self.protocols.itervalues():
    1.50 -                protocol.sendData(pc, type, message)
    1.51 +                protocol.sendData(pc, data_type, message)
    1.52  
    1.53          def echo_received(message, peer_id):
    1.54              # This is called when we receive an echo message. It