Replaced print operator by print function in network.asyncore_pollchoose

and unmaintained modules.
This commit is contained in:
Dmitri Bogomolov 2021-02-15 16:23:26 +02:00
parent 2fe2f17688
commit d8cf148d4a
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13
3 changed files with 10 additions and 10 deletions

View File

@ -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__

View File

@ -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"""

View File

@ -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()