1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-12-15 08:23:48 +03:00

* 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
This commit is contained in:
Daniel Veillard
2008-10-31 10:13:45 +00:00
parent 494cd4b4c2
commit 000818421b
6 changed files with 553 additions and 6 deletions

View File

@@ -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