summaryrefslogtreecommitdiffstats
path: root/generator.py
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@redhat.com>2006-01-31 10:24:12 +0000
committerDaniel Veillard <veillard@redhat.com>2006-01-31 10:24:12 +0000
commitfb54944e588be376fcd3fc9e01d8592a86731c41 (patch)
treefb429f11ee08c69237125a2330e00cfb139c10d0 /generator.py
parent0955d746e83c9af235aec6f4c2cb568e6ab4f1ac (diff)
downloadlibvirt-python-split-fb54944e588be376fcd3fc9e01d8592a86731c41.tar.gz
libvirt-python-split-fb54944e588be376fcd3fc9e01d8592a86731c41.tar.xz
libvirt-python-split-fb54944e588be376fcd3fc9e01d8592a86731c41.zip
* python/*: update of the python bindings, fix names, add
missing features like list of domains and domain info extraction Daniel
Diffstat (limited to 'generator.py')
-rwxr-xr-xgenerator.py29
1 files changed, 27 insertions, 2 deletions
diff --git a/generator.py b/generator.py
index b489b56..0c22482 100755
--- a/generator.py
+++ b/generator.py
@@ -202,6 +202,9 @@ def enum(type, name, value):
#
#######################################################################
+functions_failed = []
+functions_skipped = []
+
skipped_modules = {
}
@@ -254,8 +257,8 @@ foreign_encoding_args = (
# Class methods which are written by hand in libvir.c but the Python-level
# code is still automatically generated (so they are not in skip_function()).
skip_impl = (
- 'xmlSaveFileTo',
- 'xmlSaveFormatFileTo',
+ 'virConnectListDomainsID',
+ 'virDomainGetInfo',
)
def skip_function(name):
@@ -479,9 +482,11 @@ def buildStubs():
ret = print_function_wrapper(function, wrapper, export, include)
if ret < 0:
failed = failed + 1
+ functions_failed.append(function)
del functions[function]
if ret == 0:
skipped = skipped + 1
+ functions_skipped.append(function)
del functions[function]
if ret == 1:
nb_wrap = nb_wrap + 1
@@ -536,6 +541,10 @@ function_classes = {}
function_classes["None"] = []
+function_post = {
+ 'virDomainDestroy': "self._o = None",
+}
+
def nameFixup(name, classe, type, file):
listname = classe + "List"
ll = len(listname)
@@ -557,6 +566,12 @@ def nameFixup(name, classe, type, file):
func = string.lower(func[0:1]) + func[1:]
else:
func = name
+ if func == "iD":
+ func = "ID"
+ if func == "oSType":
+ func = "OSType"
+ if func == "xMLDesc":
+ func = "XMLDesc"
return func
@@ -836,6 +851,8 @@ def buildWrappers():
classes.write(classes_type[arg[1]][0])
n = n + 1
classes.write(")\n");
+ if function_post.has_key(name):
+ classes.write(" %s\n" % (function_post[name]));
if ret[0] != "void":
if classes_type.has_key(ret[0]):
#
@@ -893,6 +910,14 @@ def buildWrappers():
classes.write("%s = %s\n" % (name,value))
classes.write("\n");
+ if len(functions_skipped) != 0:
+ txt.write("\nFunctions skipped:\n")
+ for function in functions_skipped:
+ txt.write(" %s\n" % function)
+ if len(functions_failed) != 0:
+ txt.write("\nFunctions failed:\n")
+ for function in functions_failed:
+ txt.write(" %s\n" % function)
txt.close()
classes.close()