if self.options:
options += ' '
options += ' '.join('(%s)' % o for o in self.options)
- lines = [self.name + ':' + options]
+ lines = [self.name]
+ if 'SECTION' not in self.name:
+ lines[0] += ':'
+ lines[0] += options
tags = []
for name, tag in self.tags.iteritems():
if name in self.params:
block_header = block_header.strip()
cpos = block_header.find(': ')
block_name = block_header
- if cpos:
- block_name = block_name[:cpos]
+ raw_name = block_header
+ if cpos != -1:
+ block_name = block_name[:cpos].strip()
+ if block_name.endswith(':'):
+ block_name = block_name[:-1]
block = DocBlock(block_name)
block.set_position(message.Position(filename, lineno))
block = self._get_block(node)
for field in node.fields:
self._apply_annotations_field(node, block, field)
+ name = self._get_annotation_name(node)
+ section_name = 'SECTION:' + name.lower()
+ block = self._blocks.get(section_name)
+ if block:
+ node.doc = block.comment
if isinstance(node, (ast.Class, ast.Interface)):
for prop in node.properties:
self._apply_annotations_property(node, prop)