From c228387471313c39f85c873dac3f89e8c01fcc5a Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Thu, 10 Jul 2014 11:16:23 +0200 Subject: [PATCH] Do not include empty classes to the XML file generated by the genapixml tool. --- tools/genapixml.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/genapixml.py b/tools/genapixml.py index 92b503739..c63ccd28c 100755 --- a/tools/genapixml.py +++ b/tools/genapixml.py @@ -593,6 +593,11 @@ class Generator: functionNode.append(f.detailedDescription) def __generateClass(self, cclass, classesNode): + # Do not include classes that contain nothing + if len(cclass.events) == 0 and len(cclass.classMethods) == 0 and \ + len(cclass.instanceMethods) == 0 and len(cclass.properties) == 0: + return + # Check the capabilities of the class has_ref_method = False has_unref_method = False has_destroy_method = False @@ -617,6 +622,7 @@ class Generator: 'refcountable' : str(refcountable).lower(), 'destroyable' : str(destroyable).lower() } + # Generate the XML node for the class classNode = ET.SubElement(classesNode, 'class', classNodeAttributes) if len(cclass.events) > 0: eventsNode = ET.SubElement(classNode, 'events')