#NEWLINE# def send_event( self , update , topic = None ) : #NEWLINE# #INDENT# if topic : #NEWLINE# #INDENT# update . topic = self #NEWLINE# #UNINDENT# local_topic = update . topic #NEWLINE# event_json = jsonutils . dumps ( update . to_dict ( ) ) #NEWLINE# local_topic = local_topic . encode ( 'utf8' ) #NEWLINE# data = pub_sub_api . pack_message ( event_json ) #NEWLINE# self . client . publish ( local_topic , data )