diff options
author | Daniel Veillard <veillard@redhat.com> | 2006-02-28 12:17:00 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2006-02-28 12:17:00 +0000 |
commit | 9600409e58e3580ccd0e46c1da2c6a019a01ec02 (patch) | |
tree | 4a67bb2fcd028692ae616461145c0c19382f08d8 /libvir.py | |
parent | 8a85b2bf232d251c5c688721b68145fc21bf3581 (diff) | |
download | libvirt-python-v6-9600409e58e3580ccd0e46c1da2c6a019a01ec02.tar.gz libvirt-python-v6-9600409e58e3580ccd0e46c1da2c6a019a01ec02.tar.xz libvirt-python-v6-9600409e58e3580ccd0e46c1da2c6a019a01ec02.zip |
* TODO: updated
* python/Makefile.am python/generator.py python/libvir.c
python/libvir.py: improved python binding, raise exception
when an instance creation or lookup fails, and add support
for the global error handler, per conn handler still needed
* python/tests/error.py python/tests/Makefile.am: adding a
regression test
Daniel
Diffstat (limited to 'libvir.py')
-rw-r--r-- | libvir.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/libvir.py b/libvir.py new file mode 100644 index 0000000..29dc8c4 --- /dev/null +++ b/libvir.py @@ -0,0 +1,30 @@ +#!/usr/bin/python -u +# +# Those are the autogenerated Python bindings for libvirt. +# Check python/generator.py in the source distribution of libvir +# to find out more about the generation process +# +import libvirtmod +import types + +# The root of all libxml2 errors. +class libvirtError(Exception): + pass + + +# +# register the libvirt global error handler +# +def registerErrorHandler(f, ctx): + """Register a Python written function to for error reporting. + The function is called back as f(ctx, error), with error + being a list of informations about the error being raised. + Returns 1 in case of success.""" + return libvirtmod.virRegisterErrorHandler(f,ctx) + +# WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING +# +# Everything before this line comes from libvir.py +# Everything after this line is automatically generated +# +# WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING |