|
Packit |
fd8b60 |
'''
|
|
Packit |
fd8b60 |
Copyright 2011 by the Massachusetts
|
|
Packit |
fd8b60 |
Institute of Technology. All Rights Reserved.
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
Export of this software from the United States of America may
|
|
Packit |
fd8b60 |
require a specific license from the United States Government.
|
|
Packit |
fd8b60 |
It is the responsibility of any person or organization contemplating
|
|
Packit |
fd8b60 |
export to obtain such a license before exporting.
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
|
|
Packit |
fd8b60 |
distribute this software and its documentation for any purpose and
|
|
Packit |
fd8b60 |
without fee is hereby granted, provided that the above copyright
|
|
Packit |
fd8b60 |
notice appear in all copies and that both that copyright notice and
|
|
Packit |
fd8b60 |
this permission notice appear in supporting documentation, and that
|
|
Packit |
fd8b60 |
the name of M.I.T. not be used in advertising or publicity pertaining
|
|
Packit |
fd8b60 |
to distribution of the software without specific, written prior
|
|
Packit |
fd8b60 |
permission. Furthermore if you modify this software you must label
|
|
Packit |
fd8b60 |
your software as modified software and not distribute it in such a
|
|
Packit |
fd8b60 |
fashion that it might be confused with the original M.I.T. software.
|
|
Packit |
fd8b60 |
M.I.T. makes no representations about the suitability of
|
|
Packit |
fd8b60 |
this software for any purpose. It is provided "as is" without express
|
|
Packit |
fd8b60 |
or implied warranty.
|
|
Packit |
fd8b60 |
'''
|
|
Packit |
fd8b60 |
import sys
|
|
Packit |
fd8b60 |
import os
|
|
Packit |
fd8b60 |
import re
|
|
Packit |
fd8b60 |
from optparse import OptionParser
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
from doxybuilder_types import *
|
|
Packit |
fd8b60 |
from doxybuilder_funcs import *
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
def processOptions():
|
|
Packit |
fd8b60 |
usage = "\n\t\t%prog -t type -i in_dir -o out_dir"
|
|
Packit |
fd8b60 |
description = "Description:\n\tProcess doxygen output for c-types and/or functions"
|
|
Packit |
fd8b60 |
parser = OptionParser(usage=usage, description=description)
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
parser.add_option("-t", "--type", type="string", dest="action_type", help="process typedef and/or function. Possible choices: typedef, func, all. Default: all.", default="all")
|
|
Packit |
fd8b60 |
parser.add_option("-i", "--in", type="string", dest="in_dir", help="input directory")
|
|
Packit |
fd8b60 |
parser.add_option("-o", "--out", type="string", dest= "out_dir", help="output directory. Note: The subdirectory ./types will be created for typedef")
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
(options, args) = parser.parse_args()
|
|
Packit |
fd8b60 |
action = options.action_type
|
|
Packit |
fd8b60 |
in_dir = options.in_dir
|
|
Packit |
fd8b60 |
out_dir = options.out_dir
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
if in_dir is None or out_dir is None:
|
|
Packit |
fd8b60 |
parser.error("Input and output directories are required")
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
if action == "all" or action == "typedef":
|
|
Packit |
fd8b60 |
builder = DoxyBuilderTypes(in_dir, out_dir)
|
|
Packit |
fd8b60 |
builder.run_all()
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
if action == "all" or action == "func" or action == "function":
|
|
Packit |
fd8b60 |
builder = DoxyBuilderFuncs(in_dir, out_dir)
|
|
Packit |
fd8b60 |
builder.run_all()
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
if __name__ == '__main__':
|
|
Packit |
fd8b60 |
parser = processOptions()
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
|