summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDieter Verfaillie <dieterv@optionexplicit.be>2012-10-29 08:32:08 +0100
committerDieter Verfaillie <dieterv@optionexplicit.be>2012-11-28 21:31:23 +0100
commitc291bce772a09af1e884a064ceaa736712fe36a4 (patch)
tree097b889239d781eba9db4322b1b1e7cf1b8e3964
parentd5029e03561a1493470c43f8d2a08b90758baccf (diff)
downloadgobject-introspection-c291bce772a09af1e884a064ceaa736712fe36a4.tar.gz
giscanner: fix DocBlock().comment
If there is no comment block description, DocBlock().comment should be None. This results in the removal of unneeded blank lines in the output of DocBlock().to_gtk_doc and hence the .c files generated by misc/update-glib-annotations.py https://bugzilla.gnome.org/show_bug.cgi?id=688897
-rw-r--r--gir/gio-2.0.c2
-rw-r--r--gir/glib-2.0.c6
-rw-r--r--gir/gobject-2.0.c4
-rw-r--r--giscanner/annotationparser.py9
-rw-r--r--giscanner/maintransformer.py4
5 files changed, 6 insertions, 19 deletions
diff --git a/gir/gio-2.0.c b/gir/gio-2.0.c
index 1c64ec13..0ebadc78 100644
--- a/gir/gio-2.0.c
+++ b/gir/gio-2.0.c
@@ -7377,8 +7377,6 @@
* @title: GTlsBackend
* @short_description: TLS backend implementation
* @include: gio/gio.h
- *
- *
*/
diff --git a/gir/glib-2.0.c b/gir/glib-2.0.c
index 51805c44..24ed46ec 100644
--- a/gir/glib-2.0.c
+++ b/gir/glib-2.0.c
@@ -7319,8 +7319,6 @@
* SECTION:shell
* @title: Shell-related Utilities
* @short_description: shell-like commandline handling
- *
- *
*/
@@ -7328,8 +7326,6 @@
* SECTION:spawn
* @Short_description: process launching
* @Title: Spawning Processes
- *
- *
*/
@@ -16083,8 +16079,6 @@
/**
* g_io_channel_error_quark:
*
- *
- *
* Returns: the quark used as %G_IO_CHANNEL_ERROR
*/
diff --git a/gir/gobject-2.0.c b/gir/gobject-2.0.c
index dc718cec..5d6f3e55 100644
--- a/gir/gobject-2.0.c
+++ b/gir/gobject-2.0.c
@@ -5473,8 +5473,6 @@
* g_value_peek_pointer:
* @value: An initialized #GValue structure.
*
- *
- *
* Returns: (transfer none): the value contents as pointer. This function asserts that g_value_fits_pointer() returned %TRUE for the passed in value. This is an internal function introduced mainly for C marshallers.
*/
@@ -5917,8 +5915,6 @@
/**
* g_variant_get_gtype:
*
- *
- *
* Since: 2.24
* Deprecated: 2.26
*/
diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py
index 8c48d0aa..393ef38a 100644
--- a/giscanner/annotationparser.py
+++ b/giscanner/annotationparser.py
@@ -389,9 +389,10 @@ class DocBlock(object):
lines[0] += options
for param in self.params.values():
lines.append(param.to_gtk_doc_param())
- lines.append('')
- for l in self.comment.split('\n'):
- lines.append(l)
+ if self.comment:
+ lines.append('')
+ for l in self.comment.split('\n'):
+ lines.append(l)
if self.tags:
lines.append('')
for tag in self.tags.values():
@@ -1105,8 +1106,6 @@ class AnnotationParser(object):
# intended. Strip those.
if comment_block.comment:
comment_block.comment = comment_block.comment.strip()
- else:
- comment_block.comment = ''
for tag in comment_block.tags.values():
self._clean_comment_block_part(tag)
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py
index 34d153be..67168d6b 100644
--- a/giscanner/maintransformer.py
+++ b/giscanner/maintransformer.py
@@ -225,7 +225,7 @@ usage is void (*_gtk_reserved1)(void);"""
section_name = 'SECTION:' + name.lower()
block = self._blocks.get(section_name)
if block:
- node.doc = block.comment
+ node.doc = block.comment if block.comment else ''
if isinstance(node, (ast.Class, ast.Interface)):
for prop in node.properties:
self._apply_annotations_property(node, prop)
@@ -600,7 +600,7 @@ usage is void (*_gtk_reserved1)(void);"""
if block is None:
return
- node.doc = block.comment
+ node.doc = block.comment if block.comment else ''
since_tag = block.get_tag(TAG_SINCE)
if since_tag is not None: