#NEWLINE# def topic( channel , topic = None , prefix = '' , msg = None ) : #NEWLINE# #INDENT# 'Returns a TOPIC for channel with the topic topic.' #NEWLINE# if conf . supybot . protocols . irc . strictRfc ( ) : #NEWLINE# #INDENT# assert isChannel ( topic ) , repr ( channel ) #NEWLINE# #UNINDENT# if ( msg and ( not prefix ) ) : #NEWLINE# #INDENT# prefix = msg . prefix #NEWLINE# #UNINDENT# if ( topic is None ) : #NEWLINE# #INDENT# return IrcMsg ( prefix = prefix , command = 'TOPIC' , args = ( channel , ) , msg = msg ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( minisix . PY2 and isinstance ( topic , unicode ) ) : #NEWLINE# #INDENT# topic = topic . encode ( 'utf8' ) #NEWLINE# #UNINDENT# assert isinstance ( topic , str ) #NEWLINE# return IrcMsg ( prefix = prefix , command = 'TOPIC' , args = ( channel , topic ) , msg = msg )