def buildMessageRegistry(seq, suffixes=[''], bases=(Message,)):
 for (name, args) in sorted(seq):
  for suffix in suffixes:
   typename = (toTypeName(name) + suffix)
   typens = {'__slots__': args, '__assoc__': name, 'typeName': name}
   msgtype = type(typename, bases, typens)
   if (name in registry):
    registry[name] = (registry[name] + (msgtype,))
   else:
    registry[name] = (msgtype,)

def buildMessageRegistry ( seq , suffixes = [ '' ] , bases = ( Message , ) ) : for ( name , args ) in sorted ( seq ) : for suffix in suffixes : typename = ( toTypeName ( name ) + suffix ) typens = { '__slots__' : args , '__assoc__' : name , 'typeName' : name } msgtype = type ( typename , bases , typens ) if ( name in registry ) : registry [ name ] = ( registry [ name ] + ( msgtype , ) ) else : registry [ name ] = ( msgtype , )
construct message types and add to given mapping .