X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=devel%2Fnmbug%2Fnotmuch-report;h=9a6a31cc6a1ba07f9d7b10567dfcf5a558d70670;hp=94be6717c5f6fbbf012309f50b5a12771b8154ad;hb=HEAD;hpb=074f45e305ca511f260153d275b37826965a61c4 diff --git a/devel/nmbug/notmuch-report b/devel/nmbug/notmuch-report index 94be6717..9a6a31cc 100755 --- a/devel/nmbug/notmuch-report +++ b/devel/nmbug/notmuch-report @@ -1,10 +1,9 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # # Copyright (c) 2011-2012 David Bremner # # dependencies -# - python 2.6 for json -# - argparse; either python 2.7, or install separately +# - python3 or python2.7 # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,7 +16,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see http://www.gnu.org/licenses/ . +# along with this program. If not, see https://www.gnu.org/licenses/ . """Generate text and/or HTML for one or more notmuch searches. @@ -88,7 +87,7 @@ def read_config(path=None, encoding=None): else: nmbhome = os.getenv('NMBGIT', os.path.expanduser('~/.nmbug')) branch = 'config' - filename = 'status-config.json' + filename = 'notmuch-report.json' # read only the first line from the pipe sha1_bytes = subprocess.Popen( @@ -310,14 +309,17 @@ class HtmlPage (Page): return self._slug_regexp.sub('-', string) parser = argparse.ArgumentParser(description=__doc__) -parser.add_argument('--text', help='output plain text format', - action='store_true') -parser.add_argument('--config', help='load config from given file', - metavar='PATH') -parser.add_argument('--list-views', help='list views', - action='store_true') -parser.add_argument('--get-query', help='get query for view', - metavar='VIEW') +parser.add_argument( + '--text', action='store_true', help='output plain text format') +parser.add_argument( + '--config', metavar='PATH', + help='load config from given file. ' + 'The format is described in notmuch-report.json(5).') +parser.add_argument( + '--list-views', action='store_true', help='list views') +parser.add_argument( + '--get-query', metavar='VIEW', help='get query for view') + args = parser.parse_args() @@ -368,9 +370,11 @@ header_template = config['meta'].get('header', ''' border-bottom-right-radius: {border_radius}; }} tbody:nth-child(4n+1) tr td {{ + color: #000; background-color: #ffd96e; }} tbody:nth-child(4n+3) tr td {{ + color: #000; background-color: #bce; }} hr {{ @@ -412,7 +416,7 @@ _PAGES['html'] = HtmlPage( header=header_template.format(**context), footer=footer_template.format(**context), message_url_template=config['meta'].get( - 'message-url', 'http://mid.gmane.org/{message-id}'), + 'message-url', 'https://mid.gmane.org/{message-id}'), ) if args.list_views: