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
* @title: GTlsBackend
* @short_description: TLS backend implementation
* @include: gio/gio.h
* @title: GTlsBackend
* @short_description: TLS backend implementation
* @include: gio/gio.h
* SECTION:shell
* @title: Shell-related Utilities
* @short_description: shell-like commandline handling
* SECTION:shell
* @title: Shell-related Utilities
* @short_description: shell-like commandline handling
* SECTION:spawn
* @Short_description: process launching
* @Title: Spawning Processes
* SECTION:spawn
* @Short_description: process launching
* @Title: Spawning Processes
/**
* g_io_channel_error_quark:
*
/**
* g_io_channel_error_quark:
*
* Returns: the quark used as %G_IO_CHANNEL_ERROR
*/
* Returns: the quark used as %G_IO_CHANNEL_ERROR
*/
* g_value_peek_pointer:
* @value: An initialized #GValue structure.
*
* 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.
*/
* 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.
*/
/**
* g_variant_get_gtype:
*
/**
* g_variant_get_gtype:
*
* Since: 2.24
* Deprecated: 2.26
*/
* Since: 2.24
* Deprecated: 2.26
*/
lines[0] += options
for param in self.params.values():
lines.append(param.to_gtk_doc_param())
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():
if self.tags:
lines.append('')
for tag in self.tags.values():
# intended. Strip those.
if comment_block.comment:
comment_block.comment = comment_block.comment.strip()
# 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)
for tag in comment_block.tags.values():
self._clean_comment_block_part(tag)
section_name = 'SECTION:' + name.lower()
block = self._blocks.get(section_name)
if block:
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)
if isinstance(node, (ast.Class, ast.Interface)):
for prop in node.properties:
self._apply_annotations_property(node, prop)
- 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:
since_tag = block.get_tag(TAG_SINCE)
if since_tag is not None: