]> git.notmuchmail.org Git - notmuch/blobdiff - contrib/nmbug/nmbug-status
contrib/nmbug/nmbug-status: added table of views
[notmuch] / contrib / nmbug / nmbug-status
index f37ee84bb301895288ba6c68237b713ffb384dd2..c6634096ae9a48bd8e655615b6ca38be8acbdd8e 100755 (executable)
@@ -67,7 +67,7 @@ def print_view(title, query, comment):
     last['thread_id'] = ''
 
     if output_format == 'html':
-        print '<h3>%s</h3>' % title
+        print '<h3><a name="%s" />%s</h3>' % (title, title)
         print comment
         print 'The view is generated from the following query:'
         print '<blockquote>'
@@ -90,7 +90,9 @@ def print_view(title, query, comment):
                 val = str.join(' ', val.split(None)[1:4])
                 val = str(datetime.datetime.strptime(val, '%d %b %Y').date())
             elif header == 'from':
-                val = rfc822.parseaddr(val)[0]
+                (val, addr) = rfc822.parseaddr(val)
+                if val == '':
+                    val = addr.split('@')[0]
 
             if last[header] == val:
                 out[header] = ''
@@ -142,6 +144,12 @@ if output_format == 'html':
     print 'Generated: %s<br />' % datetime.datetime.utcnow().date()
     print 'For more infomation see <a href="http://notmuchmail.org/nmbug">nmbug</a>'
 
+    print '<h3>Views</h3>'
+    print '<ul>'
+    for view in config['views']:
+        print '<li><a href="#%(title)s">%(title)s</a></li>' % view
+    print '</ul>'
+
 for view in config['views']:
     print_view(**view)