def _parser():
"""Parse arguments and return a namepsace."""
- api_type = lambda x: gl_XML.parse_GL_API(x, glX_XML.glx_item_factory())
parser = argparse.ArgumentParser()
parser.add_argument('-f', '--filename',
- type=api_type,
default='gl_API.xml',
metavar="input_file_name",
- dest='api',
+ dest='file_name',
help="Path to an XML description of OpenGL API.")
parser.add_argument('-c', '--es-version',
dest='es',
def main():
"""Main function."""
args = _parser()
- PrintGlProcs(args.es).Print(args.api)
+ api = gl_XML.parse_GL_API(args.file_name, glX_XML.glx_item_factory())
+ PrintGlProcs(args.es).Print(api)
if __name__ == '__main__':
"""Parse arguments and return a namespace."""
parser = argparse.ArgumentParser()
parser.add_argument('-f', '--filename',
- type=gl_XML.parse_GL_API,
default='gl_API.xml',
metavar="input_file_name",
- dest='api',
+ dest='file_name',
help="Path to an XML description of OpenGL API.")
parser.add_argument('-m', '--mode',
choices=['table', 'remap_table'],
"""Main function."""
args = _parser()
+ api = gl_XML.parse_GL_API(args.file_name)
+
if args.mode == "table":
printer = PrintGlTable(args.es)
elif args.mode == "remap_table":
printer = PrintRemapTable(args.es)
if args.es is not None:
- args.api.filter_functions_by_api(args.es)
+ api.filter_functions_by_api(args.es)
- printer.Print(args.api)
+ printer.Print(api)
if __name__ == '__main__':
"""Parse input options and return a namsepace."""
parser = argparse.ArgumentParser()
parser.add_argument('-f', '--filename',
- type=gl_XML.parse_GL_API,
default="gl_API.xml",
metavar="input_file_name",
- dest='api',
+ dest='file_name',
help="An xml description file.")
parser.add_argument('-c', '--es-version',
choices=[None, 'es1', 'es2'],
"""Main function."""
args = _parser()
+ api = gl_XML.parse_GL_API(args.file_name)
if args.es is not None:
- args.api.filter_functions_by_api(args.es)
+ api.filter_functions_by_api(args.es)
printer = PrintGlRemap()
- printer.Print(args.api)
+ printer.Print(api)
if __name__ == '__main__':