1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-07-24 00:58:54 +03:00

Deal with old filenames for events/error functions

Older libvirt has files named 'events' and 'virterror'
rather than 'virevent' and 'virerror'. This is visible
in the API XML files. We must look for both names to
ensure we don't lose generation of methods with older
versions of libvirt.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange
2013-11-26 22:36:10 +00:00
parent 197153c67e
commit 9f02373b5e

View File

@ -113,7 +113,8 @@ class docParser(xml.sax.handler.ContentHandler):
elif tag == 'enum':
# enums come from header files, hence virterror.h
if (attrs['file'] == "libvirt" or
attrs['file'] == "virterror"):
attrs['file'] == "virterror" or
attrs['file'] == "virerror"):
enum(attrs['type'],attrs['name'],attrs['value'])
elif attrs['file'] == "libvirt-lxc":
lxc_enum(attrs['type'],attrs['name'],attrs['value'])
@ -127,8 +128,10 @@ class docParser(xml.sax.handler.ContentHandler):
# fuctions come from source files, hence 'virerror.c'
if self.function is not None:
if (self.function_module == "libvirt" or
self.function_module == "event" or
self.function_module == "virevent" or
self.function_module == "virerror"):
self.function_module == "virerror" or
self.function_module == "virterror"):
function(self.function, self.function_descr,
self.function_return, self.function_args,
self.function_file, self.function_module,