[Greater-commits] r257 - trunk/GREAT-ER-DB
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Fri Jun 24 09:38:15 CEST 2011
Author: bricks
Date: 2011-06-24 09:38:14 +0200 (Fri, 24 Jun 2011)
New Revision: 257
Added:
trunk/GREAT-ER-DB/generatewrapper.py
Log:
Add python script to generate c wrapper
Added: trunk/GREAT-ER-DB/generatewrapper.py
===================================================================
--- trunk/GREAT-ER-DB/generatewrapper.py 2011-06-23 15:18:35 UTC (rev 256)
+++ trunk/GREAT-ER-DB/generatewrapper.py 2011-06-24 07:38:14 UTC (rev 257)
@@ -0,0 +1,49 @@
+#!/usr/bin/env python
+# vim: set fileencoding=utf-8 et sw=4 ts=4 tw=80:
+
+# Copyright (c) 2011 by Intevation GmbH
+# Authors:
+# Björn Ricks <bjoern.ricks at intevation.de>
+#
+# This program is free software under the GPL (>=v2)
+# Read the file COPYING coming with the software for details.
+
+import os
+import sys
+import os.path
+
+from optparse import OptionParser
+
+sys.path.append(os.path.join(sys.path[0], "generator"))
+
+from GreaterAPIGenerator.main import generate_wrapper
+
+
+def main():
+ parser = OptionParser()
+ parser.add_option("--debug", dest="debug",
+ action="store_true", default=False,
+ help="enable debug output in wrapper")
+ parser.add_option("-o", dest="outdir",
+ help="directory to store generated files")
+ parser.add_option("-i", dest="indir",
+ help="path to apispec.py")
+ (options, args) = parser.parse_args()
+
+ if not options.outdir or not options.indir:
+ parser.print_help()
+ sys.exit(1)
+
+ if not os.path.exists(options.outdir):
+ os.makedirs(options.outdir)
+
+ generate_wrapper(os.path.join(options.indir, "apispec.py"),
+ cmodule = os.path.join(options.outdir, "_dagreater_pg"),
+ pymodule = os.path.join(options.outdir, "pydagreater.py"),
+ insert_debug_output=options.debug,
+ cheader = "daexplib_pg.h",
+ write_c_header = 0,
+ extra_headers = ("datypes_pg.h",))
+
+
+main()
Property changes on: trunk/GREAT-ER-DB/generatewrapper.py
___________________________________________________________________
Name: svn:executable
+ *
More information about the Greater-commits
mailing list