def WriteMacros(out, eclipse_langs, defines):
 out.write('  <section name="org.eclipse.cdt.internal.ui.wizards.settingswizards.Macros">\n')
 out.write('    <language name="holder for library settings"></language>\n')
 for lang in eclipse_langs:
  out.write(('    <language name="%s">\n' % lang))
  for key in sorted(defines.iterkeys()):
   out.write(('      <macro><name>%s</name><value>%s</value></macro>\n' % (escape(key), escape(defines[key]))))
  out.write('    </language>\n')
 out.write('  </section>\n')

def WriteMacros ( out , eclipse_langs , defines ) : out . write ( '  <section name="org.eclipse.cdt.internal.ui.wizards.settingswizards.Macros">\n' ) out . write ( '    <language name="holder for library settings"></language>\n' ) for lang in eclipse_langs : out . write ( ( '    <language name="%s">\n' % lang ) ) for key in sorted ( defines . iterkeys ( ) ) : out . write ( ( '      <macro><name>%s</name><value>%s</value></macro>\n' % ( escape ( key ) , escape ( defines [ key ] ) ) ) ) out . write ( '    </language>\n' ) out . write ( '  </section>\n' )
write the macros section of a cdt settings export file .