#!/usr/bin/env python # # extractuicbdoc.py - extract uicb documentation from awesome source code # Copyright (C) 2008 Julien Danjou # Copyright (C) 2008 Marco Candrian # # This is indeed crappy. Any better version, would be welcome. import sys sections = {} # [section_name] -> options infos (packed in option_doc's {}) option_order = {} # [section_name] -> options in [] (ordered like found) section_desc = {} # [section_name] -> description of section itself def sections_print(sec, indent): global sections, section_desc, option_order for opt in option_order[sec]: if sections[sec][opt][:9] == "
": print indent + opt + section_desc[sections[sec][opt][9:]] print indent + "{" indent += " " if sections[sec][opt][9:] == "style_opts": print indent + "