summaryrefslogtreecommitdiff
path: root/giscanner/maintransformer.py
diff options
context:
space:
mode:
authorDieter Verfaillie <dieterv@optionexplicit.be>2013-05-23 07:26:30 +0200
committerDieter Verfaillie <dieterv@optionexplicit.be>2013-10-08 20:54:17 +0200
commit4e48635343409b5647d2b4b3ac59c26bef45fb18 (patch)
tree3e472f93c6ee42a5fcfa9fbfa5bf76880b905565 /giscanner/maintransformer.py
parent6f910b872158a063dcadd5efc26e72e9fae3711c (diff)
downloadgobject-introspection-4e48635343409b5647d2b4b3ac59c26bef45fb18.tar.gz
giscanner: tiny MainTransformer cleanup
Diffstat (limited to 'giscanner/maintransformer.py')
-rw-r--r--giscanner/maintransformer.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py
index a614b34b..c0fc7630 100644
--- a/giscanner/maintransformer.py
+++ b/giscanner/maintransformer.py
@@ -215,7 +215,7 @@ class MainTransformer(object):
for field in node.fields:
self._apply_annotations_field(node, block, field)
name = self._get_annotation_name(node)
- section_name = 'SECTION:' + name.lower()
+ section_name = 'SECTION:%s' % (name.lower(), )
block = self._blocks.get(section_name)
if block:
node.doc = block.comment if block.comment else ''
@@ -240,12 +240,9 @@ class MainTransformer(object):
return True
def _adjust_container_type(self, parent, node, options):
- has_element_type = OPT_ELEMENT_TYPE in options
- has_array = OPT_ARRAY in options
-
- if has_array:
+ if OPT_ARRAY in options:
self._apply_annotations_array(parent, node, options)
- elif has_element_type:
+ elif OPT_ELEMENT_TYPE in options:
self._apply_annotations_element_type(parent, node, options)
if isinstance(node.type, ast.Array):