[gobject-introspection] [annotationparser] Extract (skip) for doc blocks



commit 4c733fba31673c4a9d24c9ec00b894a61a54ce3f
Author: Johan Dahlin <johan gnome org>
Date:   Sat Sep 25 11:30:54 2010 -0300

    [annotationparser] Extract (skip) for doc blocks

 giscanner/annotationparser.py |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py
index 5237a98..6eacfad 100644
--- a/giscanner/annotationparser.py
+++ b/giscanner/annotationparser.py
@@ -120,7 +120,11 @@ class DocBlock(object):
         return self.tags.get(name)
 
     def to_gtk_doc(self):
-        lines = [self.name + ':']
+        options = ''
+        if self.options:
+            options += ' '
+            options += ' '.join('(%s)' % o for o in self.options)
+        lines = [self.name + ':' + options]
         tags = []
         for name, tag in self.tags.iteritems():
             if name in self.params:
@@ -340,6 +344,9 @@ class DocOptions(object):
                 return value
         raise KeyError
 
+    def __nonzero__(self):
+        return bool(self.values)
+
     def __iter__(self):
         return (k for k, v in self.values)
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]