From d8cf148d4a142cfa6b8358ec977253bccca7f680 Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Mon, 15 Feb 2021 16:23:26 +0200 Subject: [PATCH] Replaced print operator by print function in network.asyncore_pollchoose and unmaintained modules. --- src/bitmessagecurses/__init__.py | 8 ++++---- src/network/asyncore_pollchoose.py | 2 +- src/network/http.py | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/bitmessagecurses/__init__.py b/src/bitmessagecurses/__init__.py index 1030ebb0..7c2ed733 100644 --- a/src/bitmessagecurses/__init__.py +++ b/src/bitmessagecurses/__init__.py @@ -983,7 +983,7 @@ def sendMessage(sender="", recv="", broadcast=None, subject="", body="", reply=F def loadInbox(): """Load the list of messages""" sys.stdout = sys.__stdout__ - print "Loading inbox messages..." + print("Loading inbox messages...") sys.stdout = printlog where = "toaddress || fromaddress || subject || message" @@ -1035,7 +1035,7 @@ def loadInbox(): def loadSent(): """Load the messages that sent""" sys.stdout = sys.__stdout__ - print "Loading sent messages..." + print("Loading sent messages...") sys.stdout = printlog where = "toaddress || fromaddress || subject || message" @@ -1121,7 +1121,7 @@ def loadSent(): def loadAddrBook(): """Load address book""" sys.stdout = sys.__stdout__ - print "Loading address book..." + print("Loading address book...") sys.stdout = printlog ret = sqlQuery("SELECT label, address FROM addressbook") @@ -1228,7 +1228,7 @@ def run(stdscr): def doShutdown(): """Shutting the app down""" sys.stdout = sys.__stdout__ - print "Shutting down..." + print("Shutting down...") sys.stdout = printlog shutdown.doCleanShutdown() sys.stdout = sys.__stdout__ diff --git a/src/network/asyncore_pollchoose.py b/src/network/asyncore_pollchoose.py index 41757f37..cbe0fa25 100644 --- a/src/network/asyncore_pollchoose.py +++ b/src/network/asyncore_pollchoose.py @@ -749,7 +749,7 @@ class dispatcher(object): def log_info(self, message, log_type='info'): """Conditionally print a message""" if log_type not in self.ignore_log_types: - print '%s: %s' % (log_type, message) + print('%s: %s' % (log_type, message)) def handle_read_event(self): """Handle a read event""" diff --git a/src/network/http.py b/src/network/http.py index 8bba38ac..d7a938fa 100644 --- a/src/network/http.py +++ b/src/network/http.py @@ -18,19 +18,19 @@ class HttpConnection(AdvancedDispatcher): self.destination = (host, 80) self.create_socket(socket.AF_INET, socket.SOCK_STREAM) self.connect(self.destination) - print "connecting in background to %s:%i" % (self.destination[0], self.destination[1]) + print("connecting in background to %s:%i" % self.destination) def state_init(self): self.append_write_buf( "GET %s HTTP/1.1\r\nHost: %s\r\nConnection: close\r\n\r\n" % ( self.path, self.destination[0])) - print "Sending %ib" % (len(self.write_buf)) + print("Sending %ib" % len(self.write_buf)) self.set_state("http_request_sent", 0) return False def state_http_request_sent(self): if self.read_buf: - print "Received %ib" % (len(self.read_buf)) + print("Received %ib" % len(self.read_buf)) self.read_buf = b"" if not self.connected: self.set_state("close", 0) @@ -62,13 +62,13 @@ if __name__ == "__main__": for host in ("bootstrap8080.bitmessage.org", "bootstrap8444.bitmessage.org"): proxy = Socks5Resolver(host=host) while asyncore.socket_map: - print "loop %s, len %i" % (proxy.state, len(asyncore.socket_map)) + print("loop %s, len %i" % (proxy.state, len(asyncore.socket_map))) asyncore.loop(timeout=1, count=1) proxy.resolved() proxy = Socks4aResolver(host=host) while asyncore.socket_map: - print "loop %s, len %i" % (proxy.state, len(asyncore.socket_map)) + print("loop %s, len %i" % (proxy.state, len(asyncore.socket_map))) asyncore.loop(timeout=1, count=1) proxy.resolved()