summaryrefslogtreecommitdiffstats
path: root/generator.py
diff options
context:
space:
mode:
authorDoug Goldstein <cardoe@cardoe.com>2013-11-18 16:16:23 -0600
committerDaniel P. Berrange <berrange@redhat.com>2013-11-21 17:08:43 +0000
commita0bfb1464052041f894e1a5f12a1521ef7429930 (patch)
tree66d10f6b683bc2b844950a8e7473b575be732694 /generator.py
parent5d6138f798d8d5f7b53a2ef01805f40c71016c2a (diff)
downloadlibvirt-python-v7-a0bfb1464052041f894e1a5f12a1521ef7429930.tar.gz
libvirt-python-v7-a0bfb1464052041f894e1a5f12a1521ef7429930.tar.xz
libvirt-python-v7-a0bfb1464052041f894e1a5f12a1521ef7429930.zip
Break generator.py to be called per module
Since we don't always want to build all the modules, and there might be more modules added in the future but we want to retain backwards compatibility with older libvirts, change generator.py to be called once per module instead of with all modules at once.
Diffstat (limited to 'generator.py')
-rwxr-xr-xgenerator.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/generator.py b/generator.py
index 11e45c3..00ef45a 100755
--- a/generator.py
+++ b/generator.py
@@ -17,11 +17,6 @@ import re
quiet=True
-coreapifile = sys.argv[1]
-lxcapifile = sys.argv[2]
-qemuapifile = sys.argv[3]
-
-
#######################################################################
#
# That part if purely the API acquisition phase from the
@@ -1944,13 +1939,18 @@ def lxcBuildWrappers(module):
quiet = 0
if not os.path.exists("build"):
os.mkdir("build")
-if buildStubs("libvirt", coreapifile) < 0:
- sys.exit(1)
-if buildStubs("libvirt-lxc", lxcapifile) < 0:
+
+if buildStubs(sys.argv[1], sys.argv[2]) < 0:
sys.exit(1)
-if buildStubs("libvirt-qemu", qemuapifile) < 0:
+
+if sys.argv[1] == "libvirt":
+ buildWrappers(sys.argv[1])
+elif sys.argv[1] == "libvirt-lxc":
+ lxcBuildWrappers(sys.argv[1])
+elif sys.argv[1] == "libvirt-qemu":
+ qemuBuildWrappers(sys.argv[1])
+else:
+ print "ERROR: unknown module %s" % sys.argv[1]
sys.exit(1)
-buildWrappers("libvirt")
-lxcBuildWrappers("libvirt-lxc")
-qemuBuildWrappers("libvirt-qemu")
+
sys.exit(0)