From 33c5bd65aa79df133fd9d6b3d22c89e655925d94 Mon Sep 17 00:00:00 2001 From: Shane Moore Date: Thu, 1 Dec 2016 02:25:21 -0800 Subject: [PATCH] Fix IRC port bug, more readable --- server/irc.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/irc.py b/server/irc.py index 6365fd1..c0d8cc1 100644 --- a/server/irc.py +++ b/server/irc.py @@ -182,9 +182,10 @@ class IrcClient(LoggedClass): def create_realname(host, tcp_port, ssl_port): def port_text(letter, port): - return letter if letter in DEFAULT_PORTS - and port == DEFAULT_PORTS[letter] - else letter + str(port) + if letter in DEFAULT_PORTS and port == DEFAULT_PORTS[letter]: + return letter + else: + return letter + str(port) tcp = ' ' + port_text('t', tcp_port) if tcp_port else '' ssl = ' ' + port_text('s', ssl_port) if ssl_port else '' return '{} v{}{}{}'.format(host, VERSION, tcp, ssl)