From a82ee7d7c65ec25020688ccc1986d43d50e62826 Mon Sep 17 00:00:00 2001 From: Oskar Thoren Date: Wed, 6 Feb 2019 05:29:16 -0500 Subject: [PATCH] python3 prints --- data_sync/networksim.py | 2 +- data_sync/sync.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/data_sync/networksim.py b/data_sync/networksim.py index 80f80dd..ab98411 100644 --- a/data_sync/networksim.py +++ b/data_sync/networksim.py @@ -20,7 +20,7 @@ class NetworkSimulator(): #else: #print "*** message dropped", sender.name, "->", receiver.name #print "" - print "tick", self.time + 1 + print("tick", self.time + 1) #print "-----------" for n in self.nodes: n.tick() diff --git a/data_sync/sync.py b/data_sync/sync.py index bca1c99..c78bd60 100644 --- a/data_sync/sync.py +++ b/data_sync/sync.py @@ -15,7 +15,7 @@ GROUP_ID = "0xdeadbeef" # XXX: Add debug log level def log(message): - print message + print(message) def merge_two_dicts(x, y): z = x.copy() @@ -255,7 +255,7 @@ class Node(): elif (message.header.type == 3): self.on_receive_request(sender, message) else: - print "XXX: unknown message type" + print("XXX: unknown message type") else: log("*** node {} offline, dropping message".format(self.name)) @@ -301,7 +301,7 @@ class Node(): if (message_id in self.sync_state and sender.name in self.sync_state[message_id] and self.sync_state[message_id][sender.name]['ack_flag'] == 1): - print "Have message, not ACKED yet, add to list", sender.name, message_id + print("Have message, not ACKED yet, add to list", sender.name, message_id) if sender.name not in self.offeredMessages: self.offeredMessages[sender.name] = [] self.offeredMessages[sender.name].append(message_id) @@ -475,7 +475,7 @@ def run(steps=10): d.share("B") d.share("C") - print "\nAssuming one group context (A-B (C-D) share):" + print("\nAssuming one group context (A-B (C-D) share):") # XXX: Conditional append to get message graph? # TODO: Actually need to encode graph, client concern