#NEWLINE# def publish( self , subject , msg , reply = None ) : #NEWLINE# #INDENT# '\n        Publish publishes the data argument to the given subject.\n\n        Args:\n            subject (string): a string with the subject\n            msg (string): payload string\n            reply (string): subject used in the reply\n        ' #NEWLINE# if ( msg is None ) : #NEWLINE# #INDENT# msg = '' #NEWLINE# #UNINDENT# if ( reply is None ) : #NEWLINE# #INDENT# command = ( 'PUB %s %d' % ( subject , len ( msg ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# command = ( 'PUB %s %s %d' % ( subject , reply , len ( msg ) ) ) #NEWLINE# #UNINDENT# self . _send ( command ) #NEWLINE# self . _send ( msg )