]> xenbits.xensource.com Git - libvirt.git/commitdiff
python: Fix libvirt.py generation to include virterror info
authorCole Robinson <crobinso@redhat.com>
Wed, 14 Sep 2011 20:25:42 +0000 (16:25 -0400)
committerCole Robinson <crobinso@redhat.com>
Thu, 15 Sep 2011 20:44:50 +0000 (16:44 -0400)
Recent generator refactoring broke libvirt.py. With this patch, libvirt.py
is generated exactly the same as before offending commit 9eba0d25.

python/generator.py

index 327e1d52d2c6ce99b9072c4d4c8384ae87c86674..d855d6b51017db206f7f235fc9b485f7d8a3de5a 100755 (executable)
@@ -120,7 +120,8 @@ class docParser(xml.sax.handler.ContentHandler):
                 if attrs.has_key('field'):
                     self.function_return_field = attrs['field']
         elif tag == 'enum':
-            if attrs['file'] == "libvirt":
+            if (attrs['file'] == "libvirt" or
+                attrs['file'] == "virterror"):
                 enum(attrs['type'],attrs['name'],attrs['value'])
             elif attrs['file'] == "libvirt-qemu":
                 qemu_enum(attrs['type'],attrs['name'],attrs['value'])
@@ -130,7 +131,9 @@ class docParser(xml.sax.handler.ContentHandler):
             print "end %s" % tag
         if tag == 'function':
             if self.function != None:
-                if self.function_module == "libvirt":
+                if (self.function_module == "libvirt" or
+                    self.function_module == "event" or
+                    self.function_module == "virterror"):
                     function(self.function, self.function_descr,
                              self.function_return, self.function_args,
                              self.function_file, self.function_module,