#NEWLINE# def _connect( self , network , serverPort = None , password = '' , ssl = False ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# group = conf . supybot . networks . get ( network ) #NEWLINE# ( server , port ) = group . servers ( ) [ 0 ] #NEWLINE# #UNINDENT# except ( registry . NonExistentRegistryEntry , IndexError ) : #NEWLINE# #INDENT# if ( serverPort is None ) : #NEWLINE# #INDENT# raise ValueError ( 'connect requires a (server, port) if the network is not registered.' ) #NEWLINE# #UNINDENT# conf . registerNetwork ( network , password , ssl ) #NEWLINE# serverS = ( '%s:%s' % serverPort ) #NEWLINE# conf . supybot . networks . get ( network ) . servers . append ( serverS ) #NEWLINE# assert conf . supybot . networks . get ( network ) . servers ( ) , ( 'No servers are set for the %s network.' % network ) #NEWLINE# #UNINDENT# self . log . debug ( 'Creating new Irc for %s.' , network ) #NEWLINE# newIrc = irclib . Irc ( network ) #NEWLINE# for irc in world . ircs : #NEWLINE# #INDENT# if ( irc != newIrc ) : #NEWLINE# #INDENT# newIrc . state . history = irc . state . history #NEWLINE# #UNINDENT# #UNINDENT# driver = drivers . newDriver ( port ) #NEWLINE# self . _loadPlugins ( newIrc ) #NEWLINE# return newIrc