[meld] maint: Fix templating for releases with no feature section



commit 02a8bd8d6c33cd8ec5a74afb2ffa8a0b116e223e
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Fri Sep 19 07:34:37 2014 +1000

    maint: Fix templating for releases with no feature section

 maint.py |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/maint.py b/maint.py
index be487f0..cef24c5 100755
--- a/maint.py
+++ b/maint.py
@@ -39,6 +39,7 @@ NEWS_TEMPLATE = """
 EMAIL_TEMPLATE = """
 {{ app|title }} {{version}} has been released, and is now available at:
   http://download.gnome.org/sources/meld/{{ version|minor_version }}/{{ app }}-{{ version }}.tar.xz
+{%- if features %}
 
 
 Features
@@ -46,6 +47,7 @@ Features
 {% for feature in features %}
  {{ feature }}
 {%- endfor %}
+{%- endif %}
 
 
 Fixes
@@ -79,12 +81,14 @@ MARKDOWN_TEMPLATE = """
 {{ [date, app, version]|join(' ') }}
 {{ '=' * [date, app, version]|join(' ')|length }}
 -->
+{%- if features %}
 
 Features
 --------
 {% for feature in features %}
 {{ feature }}
 {%- endfor %}
+{%- endif %}
 
 Fixes
 -----
@@ -180,6 +184,9 @@ def parse_news_entry(news):
         sections[section].append(line)
 
     def reformat(section):
+        if not section:
+            return section
+
         def space_prefix(s):
             for i in range(1, len(s)):
                 if not s[:i].isspace():


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