def _strify_spec(spec, buff=None, indent=''):
 if (buff is None):
  buff = StringIO()
 for c in spec.constants:
  buff.write(('%s%s %s=%s\n' % (indent, c.type, c.name, c.val_text)))
 for (type_, name) in zip(spec.types, spec.names):
  buff.write(('%s%s %s\n' % (indent, type_, name)))
  base_type = base_msg_type(type_)
  if (not (base_type in BUILTIN_TYPES)):
   subspec = get_registered(base_type)
   _strify_spec(subspec, buff, (indent + '  '))
 return buff.getvalue()

def _strify_spec ( spec , buff = None , indent = '' ) : if ( buff is None ) : buff = StringIO ( ) for c in spec . constants : buff . write ( ( '%s%s %s=%s\n' % ( indent , c . type , c . name , c . val_text ) ) ) for ( type_ , name ) in zip ( spec . types , spec . names ) : buff . write ( ( '%s%s %s\n' % ( indent , type_ , name ) ) ) base_type = base_msg_type ( type_ ) if ( not ( base_type in BUILTIN_TYPES ) ) : subspec = get_registered ( base_type ) _strify_spec ( subspec , buff , ( indent + '  ' ) ) return buff . getvalue ( )
convert spec into a string representation .