]> git.notmuchmail.org Git - notmuch/blobdiff - devel/nmbug/nmbug-status
nmbug-status: Factor out header/footer context into a shared dict
[notmuch] / devel / nmbug / nmbug-status
index e137a90ed07582dd0afe6af66aa984c3bbf7724f..b7c2f80ec75133cdddd983ad227f0d3608e2e832 100755 (executable)
@@ -275,6 +275,14 @@ parser.add_argument('--get-query', help='get query for view',
 args = parser.parse_args()
 
 config = read_config(path=args.config)
+context = {
+    'date': datetime.datetime.utcnow(),
+    'title': config['meta']['title'],
+    'blurb': config['meta']['blurb'],
+    'encoding': _ENCODING,
+    'inter_message_padding': '0.25em',
+    'border_radius': '0.5em',
+    }
 
 _PAGES['text'] = Page()
 _PAGES['html'] = HtmlPage(
@@ -315,22 +323,26 @@ _PAGES['html'] = HtmlPage(
     tbody:nth-child(4n+3) tr td {{
       background-color: #bce;
     }}
+    hr {{
+      border: 0;
+      height: 1px;
+      color: #ccc;
+      background-color: #ccc;
+    }}
   </style>
 </head>
 <body>
 <h2>{title}</h2>
-<p>
-Generated: {date}<br />
 {blurb}
 </p>
 <h3>Views</h3>
-'''.format(date=datetime.datetime.utcnow().date(),
-           title=config['meta']['title'],
-           blurb=config['meta']['blurb'],
-           encoding=_ENCODING,
-           inter_message_padding='0.25em',
-           border_radius='0.5em'),
-    footer='</body>\n</html>\n',
+'''.format(**context),
+    footer='''
+<hr>
+<p>Generated: {date}
+</body>
+</html>
+'''.format(**context),
     )
 
 if args.list_views: