aboutsummaryrefslogtreecommitdiffstats
path: root/bin/eo_py_gen.py
diff options
context:
space:
mode:
Diffstat (limited to 'bin/eo_py_gen.py')
-rwxr-xr-xbin/eo_py_gen.py39
1 files changed, 9 insertions, 30 deletions
diff --git a/bin/eo_py_gen.py b/bin/eo_py_gen.py
index e43e4a9..1874584 100755
--- a/bin/eo_py_gen.py
+++ b/bin/eo_py_gen.py
@@ -50,7 +50,6 @@ def setup_file_generate(args, outdir):
lines.append("(e_compile_args, e_link_args) = pkgconfig(\"%s\")"%pkg)
lines.append("")
-
if cpp_defines is not None:
for d in cpp_defines:
lines.append("e_compile_args.append(\"-D%s\")"%d)
@@ -109,23 +108,23 @@ def setup_file_generate(args, outdir):
def main():
parser = ArgumentParser()
parser.add_argument("-d", "--dir", dest="directory",
- action="append", help="Source files")
+ action="append", help="Path to XML descriptions", required=True)
parser.add_argument("-o", "--outdir", dest="outdir",
- action="store", help="Output directory")
+ action="store", help="Output directory", required=True)
parser.add_argument("-v", "--verbose",
action="store_true", dest="verbose", default=False,
- help="Print status messages to stdout. Default: False")
+ help="Verbose output")
parser.add_argument("-X", "--xmldir", dest="xmldir", default=sys.path,
- action="append", help="Include eobase directory")
+ action="append", help="Directory to search for parent classes's XMLs")
parser.add_argument("--pkg", dest="pkg", default = "eo",
action="store", help="pkg-confing libraries. Default: \"eo\"")
parser.add_argument("-m", "--module", dest="module",
- action="store", help="Name of module to generate")
+ action="store", help="Name of module", required=True)
parser.add_argument("-I", "--include", dest="include_paths",
action="append", help="Pre-processor include path")
@@ -143,41 +142,22 @@ def main():
verbose_print = verbose_true if args.verbose is True else verbose_false
- verbose_print("Options: %s"%args)
-
directories = []
outdir = ""
sourcedir = ""
incl_dirs = []
- if args.directory == None:
- print "ERROR: No source directory was provided"
- exit(1)
- elif args.outdir == None:
- print "ERROR: No out directory was provided"
- exit(1)
- elif args.module == None:
- print "ERROR: No module name was provided"
- exit(1)
- else:
- directories = abs_path_get(args.directory)
- outdir = abs_path_get([args.outdir])[0]
- if args.xmldir is not None:
- incl_dirs = abs_path_get(args.xmldir, False)
-
-
- verbose_print("Dirs: %s"%directories)
- verbose_print("Outdir: %s"%outdir)
- verbose_print("Include dirs: %s"%incl_dirs)
+ directories = abs_path_get(args.directory)
+ outdir = abs_path_get([args.outdir])[0]
+ if args.xmldir is not None:
+ incl_dirs = abs_path_get(args.xmldir, False)
xml_files = dir_files_get(directories, False)
xml_files = filter(isXML, xml_files)
- verbose_print("In Files: %s"%xml_files)
xp = XMLparser()
xp.module_parse(args.module, xml_files, incl_dirs)
-
if args.module == "eobase":
outdir_tmp = os.path.join(outdir, const.PREFIX)
if not os.path.exists(outdir_tmp):
@@ -192,7 +172,6 @@ def main():
if args.module == "eobase":
for d in incl_dirs:
d_tmp = os.path.join(d, "eodefault.pxd")
- #print "dir: ", d_tmp
if os.path.exists(d_tmp):
sourcedir = d
break