minor style improvements

This commit is contained in:
Maximilian Hils 2015-07-22 16:00:32 +02:00
parent c3c3d28bb1
commit 9b3fe80697
1 changed files with 6 additions and 6 deletions

View File

@ -167,12 +167,12 @@ class ConnectionHandler:
self.channel.tell("serverdisconnect", self) self.channel.tell("serverdisconnect", self)
self.server_conn = None self.server_conn = None
def set_server_address(self, address): def set_server_address(self, addr):
""" """
Sets a new server address with the given priority. Sets a new server address with the given priority.
Does not re-establish either connection or SSL handshake. Does not re-establish either connection or SSL handshake.
""" """
address = tcp.Address.wrap(address) address = tcp.Address.wrap(addr)
# Don't reconnect to the same destination. # Don't reconnect to the same destination.
if self.server_conn and self.server_conn.address == address: if self.server_conn and self.server_conn.address == address:
@ -309,15 +309,15 @@ class ConnectionHandler:
self.client_conn.finish() self.client_conn.finish()
def log(self, msg, level, subs=()): def log(self, msg, level, subs=()):
msg = [ full_msg = [
"%s:%s: %s" % "%s:%s: %s" %
(self.client_conn.address.host, (self.client_conn.address.host,
self.client_conn.address.port, self.client_conn.address.port,
msg)] msg)]
for i in subs: for i in subs:
msg.append(" -> " + i) full_msg.append(" -> " + i)
msg = "\n".join(msg) full_msg = "\n".join(full_msg)
self.channel.tell("log", Log(msg, level)) self.channel.tell("log", Log(full_msg, level))
def find_cert(self): def find_cert(self):
host = self.server_conn.address.host host = self.server_conn.address.host