diff options
author | Daniel Veillard <veillard@redhat.com> | 2008-10-31 10:13:45 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2008-10-31 10:13:45 +0000 |
commit | 000818421b5007e1ee65c3fa8fef12bcf08feea2 (patch) | |
tree | 2dfd825507d5c75d1ee393bf229706f48dcf2f56 /generator.py | |
parent | 494cd4b4c291391cc5f4f3c20e4f60667c1dd2fb (diff) | |
download | libvirt-python-v6-000818421b5007e1ee65c3fa8fef12bcf08feea2.tar.gz libvirt-python-v6-000818421b5007e1ee65c3fa8fef12bcf08feea2.tar.xz libvirt-python-v6-000818421b5007e1ee65c3fa8fef12bcf08feea2.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 'generator.py')
-rwxr-xr-x | generator.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/generator.py b/generator.py index ca83eaf..7b153b9 100755 --- a/generator.py +++ b/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 |