#NEWLINE# def _formatTopics( self , irc , channel , topics , fit = False ) : #NEWLINE# #INDENT# topics = [ s for s in topics if ( s and ( not s . isspace ( ) ) ) ] #NEWLINE# self . lastTopics [ channel ] = topics #NEWLINE# newTopic = self . _joinTopic ( channel , topics ) #NEWLINE# try : #NEWLINE# #INDENT# maxLen = irc . state . supported [ 'topiclen' ] #NEWLINE# if fit : #NEWLINE# #INDENT# while ( len ( newTopic ) > s ) : #NEWLINE# #INDENT# topics . pop ( 0 ) #NEWLINE# self . lastTopics [ channel ] = topics #NEWLINE# newTopic = self . _joinTopic ( channel , topics ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( newTopic ) > maxLen ) : #NEWLINE# #INDENT# if self . registryValue ( 'recognizeTopiclen' , channel ) : #NEWLINE# #INDENT# irc . error ( format ( _ ( 'That topic is too long for this server (maximum length: %i; this topic: %i).' ) , maxLen , len ( newTopic ) ) , Raise = True ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# except KeyError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# return newTopic