From 9f02373b5ee338ef23f554d5be741be8701405bb Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Tue, 26 Nov 2013 22:36:10 +0000 Subject: [PATCH] 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 --- generator.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/generator.py b/generator.py index 273efbd..cd857b4 100755 --- a/generator.py +++ b/generator.py @@ -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,