From f4423b93bd19438c21c33caafc5cdd43a9164f96 Mon Sep 17 00:00:00 2001
From: Ghislain MARY <ghislain.mary@belledonne-communications.com>
Date: Tue, 12 Aug 2014 17:37:55 +0200
Subject: [PATCH] Add documentation for the properties in the Python wrapper.

---
 tools/python/apixml2python/linphone.py              | 8 ++++++--
 tools/python/apixml2python/linphone_module.mustache | 3 +--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/tools/python/apixml2python/linphone.py b/tools/python/apixml2python/linphone.py
index dd818ccb1f..7d3fe62806 100644
--- a/tools/python/apixml2python/linphone.py
+++ b/tools/python/apixml2python/linphone.py
@@ -846,10 +846,14 @@ class LinphoneModule(object):
 				raise
 			try:
 				for p in c['class_properties']:
-					if p.has_key('getter_xml_node'):
-						p['getter_body'] = GetterMethodDefinition(self, c, p['getter_xml_node']).format()
+					p['property_doc'] = ''
 					if p.has_key('setter_xml_node'):
 						p['setter_body'] = SetterMethodDefinition(self, c, p['setter_xml_node']).format()
+						p['property_doc'] = self.__format_doc(p['setter_xml_node'].find('briefdescription'), p['setter_xml_node'].find('detaileddescription'))
+					if p.has_key('getter_xml_node'):
+						p['getter_body'] = GetterMethodDefinition(self, c, p['getter_xml_node']).format()
+						if p['property_doc'] == '':
+							p['property_doc'] = self.__format_doc(p['getter_xml_node'].find('briefdescription'), p['getter_xml_node'].find('detaileddescription'))
 			except Exception, e:
 				e.args += (c['class_name'], p['property_name'])
 				raise
diff --git a/tools/python/apixml2python/linphone_module.mustache b/tools/python/apixml2python/linphone_module.mustache
index 3680fdcd4c..ee072aeaed 100644
--- a/tools/python/apixml2python/linphone_module.mustache
+++ b/tools/python/apixml2python/linphone_module.mustache
@@ -139,9 +139,8 @@ static PyMethodDef pylinphone_{{class_name}}_methods[] = {
 {{/class_properties}}
 
 static PyGetSetDef pylinphone_{{class_name}}_getseters[] = {
-	// TODO: Handle doc
 {{#class_properties}}
-	{ "{{property_name}}", {{getter_reference}}, {{setter_reference}}, "" },
+	{ "{{property_name}}", {{getter_reference}}, {{setter_reference}}, "{{{property_doc}}}" },
 {{/class_properties}}
 	/* Sentinel */
 	{ NULL, NULL, NULL, NULL, NULL }
-- 
GitLab