Commits

Jason R. Coombs committed 2db9057

Update SingleServerIRCBot to pass keyword arguments through to the connect method.

Comments (0)

Files changed (2)

+3.5
+===
+
+* SingleServerIRCBot now accepts keyword arguments which are passed through
+  to the `ServerConnection.connect` method. One can use this to use SSL for
+  connections::
+
+    factory = irc.connection.Factory(wrapper=ssl.wrap_socket)
+    bot = irc.bot.SingleServerIRCBot(..., connect_factory = factory)
+
+
 3.4.2
 =====
 
 implemented and never tested.
 
 * The ServerConnection now allows custom classes to be supplied to customize
-  the decoding of incoming lines. For example, to disable the decoding of incoming lines,
+  the decoding of incoming lines. For example, to disable the decoding of
+  incoming lines,
   replace the `buffer_class` on the ServerConnection with a version that
   passes through the lines directly::
 
     have operator or voice modes.  The "database" is kept in the
     self.channels attribute, which is an IRCDict of Channels.
     """
-    def __init__(self, server_list, nickname, realname, reconnection_interval=60, ssl=False):
+    def __init__(self, server_list, nickname, realname, reconnection_interval=60,
+            **connect_params):
         """Constructor for SingleServerIRCBot objects.
 
         Arguments:
             dcc_connections -- A list of initiated/accepted DCC
             connections.
 
-            ssl -- Connect to server using SSL
+            **connect_params -- parameters to pass through to the connect
+                                method.
         """
 
         super(SingleServerIRCBot, self).__init__()
+        self.__connect_params = connect_params
         self.channels = IRCDict()
-        self.ssl = ssl
         self.server_list = server_list
         if not reconnection_interval or reconnection_interval < 0:
             reconnection_interval = 2 ** 31
                          self._nickname,
                          password,
                          ircname=self._realname,
-                         ssl=self.ssl)
+                         **self.__connect_params
+            )
         except irc.client.ServerConnectionError:
             pass