#!/usr/bin/env python

import sys
import pyembroidery

formats = [format for format in pyembroidery.supported_formats() if 'writer' in format]
formats.sort(key=lambda format: (format['category'] != 'embroidery', format['extension']))

for format in formats:
    tag = ""
    if format['category'] != 'embroidery':
        tag = " [DEBUG]"

    print '<_option value="%s">%s(%s)%s</_option>' % (format['extension'], format['description'], format['extension'].upper(), tag)
