Tweak doxy2swig.py output to include Returns header
authorDan White <dan@whiteaudio.com>
Thu, 1 Nov 2012 02:46:53 +0000 (21:46 -0500)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 19 Nov 2012 08:45:44 +0000 (09:45 +0100)
Underlines are proportional to the title now also.

bindings/doxy2swig.py

index 96573dc..c6c972c 100644 (file)
@@ -237,6 +237,7 @@ class Doxy2SWIG:
             if key == 'kind':
                 if val == 'param': text = 'Parameters'
                 elif val == 'exception': text = 'Exceptions'
+                elif val == 'retval': text = 'Returns'
                 else: text = val
                 break
         self.add_text(['\n', '\n', text, ':', '\n'])
@@ -410,8 +411,8 @@ class Doxy2SWIG:
         _data = "".join(ret)
         ret = []
         for i in _data.split('\n\n'):
-            if i == 'Parameters:' or i == 'Exceptions:':
-                ret.extend([i, '\n-----------', '\n\n'])
+            if i == 'Parameters:' or i == 'Exceptions:' or i == 'Returns:':
+                ret.extend([i, '\n'+'-'*len(i), '\n\n'])
             elif i.find('// File:') > -1: # leave comments alone.
                 ret.extend([i, '\n'])
             else: