Replaced print operator by print function in network.asyncore_pollchoose
and unmaintained modules.
This commit is contained in:
parent
2fe2f17688
commit
d8cf148d4a
|
@ -983,7 +983,7 @@ def sendMessage(sender="", recv="", broadcast=None, subject="", body="", reply=F
|
||||||
def loadInbox():
|
def loadInbox():
|
||||||
"""Load the list of messages"""
|
"""Load the list of messages"""
|
||||||
sys.stdout = sys.__stdout__
|
sys.stdout = sys.__stdout__
|
||||||
print "Loading inbox messages..."
|
print("Loading inbox messages...")
|
||||||
sys.stdout = printlog
|
sys.stdout = printlog
|
||||||
|
|
||||||
where = "toaddress || fromaddress || subject || message"
|
where = "toaddress || fromaddress || subject || message"
|
||||||
|
@ -1035,7 +1035,7 @@ def loadInbox():
|
||||||
def loadSent():
|
def loadSent():
|
||||||
"""Load the messages that sent"""
|
"""Load the messages that sent"""
|
||||||
sys.stdout = sys.__stdout__
|
sys.stdout = sys.__stdout__
|
||||||
print "Loading sent messages..."
|
print("Loading sent messages...")
|
||||||
sys.stdout = printlog
|
sys.stdout = printlog
|
||||||
|
|
||||||
where = "toaddress || fromaddress || subject || message"
|
where = "toaddress || fromaddress || subject || message"
|
||||||
|
@ -1121,7 +1121,7 @@ def loadSent():
|
||||||
def loadAddrBook():
|
def loadAddrBook():
|
||||||
"""Load address book"""
|
"""Load address book"""
|
||||||
sys.stdout = sys.__stdout__
|
sys.stdout = sys.__stdout__
|
||||||
print "Loading address book..."
|
print("Loading address book...")
|
||||||
sys.stdout = printlog
|
sys.stdout = printlog
|
||||||
|
|
||||||
ret = sqlQuery("SELECT label, address FROM addressbook")
|
ret = sqlQuery("SELECT label, address FROM addressbook")
|
||||||
|
@ -1228,7 +1228,7 @@ def run(stdscr):
|
||||||
def doShutdown():
|
def doShutdown():
|
||||||
"""Shutting the app down"""
|
"""Shutting the app down"""
|
||||||
sys.stdout = sys.__stdout__
|
sys.stdout = sys.__stdout__
|
||||||
print "Shutting down..."
|
print("Shutting down...")
|
||||||
sys.stdout = printlog
|
sys.stdout = printlog
|
||||||
shutdown.doCleanShutdown()
|
shutdown.doCleanShutdown()
|
||||||
sys.stdout = sys.__stdout__
|
sys.stdout = sys.__stdout__
|
||||||
|
|
|
@ -749,7 +749,7 @@ class dispatcher(object):
|
||||||
def log_info(self, message, log_type='info'):
|
def log_info(self, message, log_type='info'):
|
||||||
"""Conditionally print a message"""
|
"""Conditionally print a message"""
|
||||||
if log_type not in self.ignore_log_types:
|
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):
|
def handle_read_event(self):
|
||||||
"""Handle a read event"""
|
"""Handle a read event"""
|
||||||
|
|
|
@ -18,19 +18,19 @@ class HttpConnection(AdvancedDispatcher):
|
||||||
self.destination = (host, 80)
|
self.destination = (host, 80)
|
||||||
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
|
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
self.connect(self.destination)
|
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):
|
def state_init(self):
|
||||||
self.append_write_buf(
|
self.append_write_buf(
|
||||||
"GET %s HTTP/1.1\r\nHost: %s\r\nConnection: close\r\n\r\n" % (
|
"GET %s HTTP/1.1\r\nHost: %s\r\nConnection: close\r\n\r\n" % (
|
||||||
self.path, self.destination[0]))
|
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)
|
self.set_state("http_request_sent", 0)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def state_http_request_sent(self):
|
def state_http_request_sent(self):
|
||||||
if self.read_buf:
|
if self.read_buf:
|
||||||
print "Received %ib" % (len(self.read_buf))
|
print("Received %ib" % len(self.read_buf))
|
||||||
self.read_buf = b""
|
self.read_buf = b""
|
||||||
if not self.connected:
|
if not self.connected:
|
||||||
self.set_state("close", 0)
|
self.set_state("close", 0)
|
||||||
|
@ -62,13 +62,13 @@ if __name__ == "__main__":
|
||||||
for host in ("bootstrap8080.bitmessage.org", "bootstrap8444.bitmessage.org"):
|
for host in ("bootstrap8080.bitmessage.org", "bootstrap8444.bitmessage.org"):
|
||||||
proxy = Socks5Resolver(host=host)
|
proxy = Socks5Resolver(host=host)
|
||||||
while asyncore.socket_map:
|
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)
|
asyncore.loop(timeout=1, count=1)
|
||||||
proxy.resolved()
|
proxy.resolved()
|
||||||
|
|
||||||
proxy = Socks4aResolver(host=host)
|
proxy = Socks4aResolver(host=host)
|
||||||
while asyncore.socket_map:
|
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)
|
asyncore.loop(timeout=1, count=1)
|
||||||
proxy.resolved()
|
proxy.resolved()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user