def _AddSetListenerMethod(cls):
 def SetListener(self, listener):
  if (listener is None):
   self._listener = message_listener_mod.NullMessageListener()
  else:
   self._listener = listener
 cls._SetListener = SetListener

def _AddSetListenerMethod ( cls ) : def SetListener ( self , listener ) : if ( listener is None ) : self . _listener = message_listener_mod . NullMessageListener ( ) else : self . _listener = listener cls . _SetListener = SetListener
helper for _addmessagemethods() .