aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@redhat.com>2008-10-31 10:13:45 +0000
committerDaniel Veillard <veillard@redhat.com>2008-10-31 10:13:45 +0000
commit7b716fce8ecaaef408f0e5ddc8f8349f86300af7 (patch)
treeda234210a2291046fe7238fa028bab812f15be48 /python/generator.py
parentAdd a test storage driver. (diff)
downloadlibvirt-7b716fce8ecaaef408f0e5ddc8f8349f86300af7.tar.gz
libvirt-7b716fce8ecaaef408f0e5ddc8f8349f86300af7.tar.bz2
libvirt-7b716fce8ecaaef408f0e5ddc8f8349f86300af7.zip
* python/Makefile.am python/generator.py python/libvir.c
python/libvir.py python/libvirt_wrap.h python/types.c: adds support for events from the python bindings, also improves the generator allowing to embbed per function definition files, patch by Ben Guthro * examples/domain-events/events-python/event-test.py: also adds a programming example Daniel
Diffstat (limited to 'python/generator.py')
-rwxr-xr-xpython/generator.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/python/generator.py b/python/generator.py
index ca83eafe2..7b153b9cd 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -213,6 +213,8 @@ skipped_modules = {
skipped_types = {
# 'int *': "usually a return type",
+ 'virConnectDomainEventCallback': "No function types in python",
+ 'virEventAddHandleFunc': "No function types in python",
}
#######################################################################
@@ -315,6 +317,7 @@ skip_impl = (
'virStoragePoolListVolumes',
'virDomainBlockPeek',
'virDomainMemoryPeek',
+ 'virEventRegisterImpl',
)
@@ -332,9 +335,8 @@ skip_function = (
'virCopyLastError', # Python API is called virGetLastError instead
'virConnectOpenAuth', # Python C code is manually written
'virDefaultErrorFunc', # Python virErrorFuncHandler impl calls this from C
- 'virConnectDomainEventRegister', # TODO: generate python bindings for these below XXX
- 'virConnectDomainEventDeregister',
- 'virEventRegisterImpl',
+ 'virConnectDomainEventRegister', # overridden in virConnect.py
+ 'virConnectDomainEventDeregister', # overridden in virConnect.py
)
@@ -615,7 +617,6 @@ classes_destructors = {
"virNetwork": "virNetworkFree",
"virStoragePool": "virStoragePoolFree",
"virStorageVol": "virStorageVolFree",
- "virConnect": "virConnectClose",
}
functions_noexcept = {
@@ -1210,6 +1211,16 @@ def buildWrappers():
classes.write(" return ret\n");
classes.write("\n");
+ # Append "<classname>.py" to class def, iff it exists
+ try:
+ extra = open(classname + ".py", "r")
+ classes.write (" #\n")
+ classes.write (" # %s methods from %s.py (hand coded)\n" % (classname,classname))
+ classes.write (" #\n")
+ classes.writelines(extra.readlines())
+ extra.close()
+ except:
+ pass
#
# Generate enum constants