def register(func, msg_type=None, dispatcher_name=None, active_by_default=True):
 if (msg_type and (msg_type not in MSG_TYPE_MAP)):
  raise InvalidHandlerType(('Invalid message type [%s]: type should be in %s' % (msg_type, str(MSG_TYPES))))
 handler = Handler(func=func, name=dispatcher_name)
 if (msg_type is None):
  _registry[RAW_TYPE].append(handler)
 else:
  _registry[msg_type].append(handler)
 if active_by_default:
  _active.add(dispatcher_name)

def register ( func , msg_type = None , dispatcher_name = None , active_by_default = True ) : if ( msg_type and ( msg_type not in MSG_TYPE_MAP ) ) : raise InvalidHandlerType ( ( 'Invalid message type [%s]: type should be in %s' % ( msg_type , str ( MSG_TYPES ) ) ) ) handler = Handler ( func = func , name = dispatcher_name ) if ( msg_type is None ) : _registry [ RAW_TYPE ] . append ( handler ) else : _registry [ msg_type ] . append ( handler ) if active_by_default : _active . add ( dispatcher_name )
register language support with the manager .