@@ -46,12 +46,11 @@ class IrcClient(Client):
4646 :type _ignore_cert_errors: bool
4747 """
4848
49- def __init__ (self , bot , name , nick , * , readable_name , channels = None , config = None ,
49+ def __init__ (self , bot , name , nick , * , channels = None , config = None ,
5050 server , port = 6667 , use_ssl = False , ignore_cert_errors = True , timeout = 300 , local_bind = False ):
5151 """
5252 :type bot: cloudbot.bot.CloudBot
5353 :type name: str
54- :type readable_name: str
5554 :type nick: str
5655 :type channels: list[str]
5756 :type config: dict[str, unknown]
@@ -61,7 +60,7 @@ def __init__(self, bot, name, nick, *, readable_name, channels=None, config=None
6160 :type ignore_cert_errors: bool
6261 :type timeout: int
6362 """
64- super ().__init__ (bot , name , nick , readable_name = readable_name , channels = channels , config = config )
63+ super ().__init__ (bot , name , nick , channels = channels , config = config )
6564
6665 self .use_ssl = use_ssl
6766 self ._ignore_cert_errors = ignore_cert_errors
@@ -106,11 +105,11 @@ def connect(self):
106105 return
107106
108107 if self ._connected :
109- logger .info ("[{}] Reconnecting" .format (self .readable_name ))
108+ logger .info ("[{}] Reconnecting" .format (self .name ))
110109 self ._transport .close ()
111110 else :
112111 self ._connected = True
113- logger .info ("[{}] Connecting" .format (self .readable_name ))
112+ logger .info ("[{}] Connecting" .format (self .name ))
114113 optional_params = {}
115114 if self .local_bind :
116115 optional_params ["local_addr" ] = self .local_bind
@@ -208,7 +207,7 @@ def _send(self, line):
208207 Sends a raw IRC line unchecked. Doesn't do connected check, and is *not* threadsafe
209208 :type line: str
210209 """
211- logger .info ("[{}] >> {}" .format (self .readable_name , line ))
210+ logger .info ("[{}] >> {}" .format (self .name , line ))
212211 asyncio .async (self ._protocol .send (line ), loop = self .loop )
213212
214213
@@ -262,14 +261,14 @@ def connection_lost(self, exc):
262261 if exc is None :
263262 # we've been closed intentionally, so don't reconnect
264263 return
265- logger .error ("[{}] Connection lost: {}" .format (self .conn .readable_name , exc ))
264+ logger .error ("[{}] Connection lost: {}" .format (self .conn .name , exc ))
266265 asyncio .async (self .conn .connect (), loop = self .loop )
267266
268267 def eof_received (self ):
269268 self ._connected = False
270269 # create a new connected_future for when we are connected.
271270 self ._connected_future = asyncio .Future (loop = self .loop )
272- logger .info ("[{}] EOF received." .format (self .conn .readable_name ))
271+ logger .info ("[{}] EOF received." .format (self .conn .name ))
273272 asyncio .async (self .conn .connect (), loop = self .loop )
274273 return True
275274
@@ -294,7 +293,7 @@ def data_received(self, data):
294293 prefix_line_match = irc_prefix_re .match (line )
295294 if prefix_line_match is None :
296295 logger .critical ("[{}] Received invalid IRC line '{}' from {}" .format (
297- self .conn .readable_name , line , self .conn .describe_server ()))
296+ self .conn .name , line , self .conn .describe_server ()))
298297 continue
299298
300299 netmask_prefix , command , params = prefix_line_match .groups ()
@@ -316,7 +315,7 @@ def data_received(self, data):
316315 noprefix_line_match = irc_noprefix_re .match (line )
317316 if noprefix_line_match is None :
318317 logger .critical ("[{}] Received invalid IRC line '{}' from {}" .format (
319- self .conn .readable_name , line , self .conn .describe_server ()))
318+ self .conn .name , line , self .conn .describe_server ()))
320319 continue
321320 command = noprefix_line_match .group (1 )
322321 params = noprefix_line_match .group (2 )
0 commit comments