X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=notmuch-to-html;h=0d0831f3fd8a9746d388087eea5801b30a4e47b5;hb=61819058a9f7804efddfbe596785abf7eea349db;hp=663dd8733e0129163ff745b9aef1ac42d57f12cf;hpb=336411fb8710d395fc76cbe958e137360b5fda33;p=obsolete%2Fnotmuch-to-html diff --git a/notmuch-to-html b/notmuch-to-html index 663dd87..0d0831f 100755 --- a/notmuch-to-html +++ b/notmuch-to-html @@ -4,6 +4,7 @@ # searches, (with links to gmane views of each email if available). # # Copyright (c) 2011-2012 David Bremner +# Copyright (c) 2014 Carl Worth

{title}

-

-Generated: {date}
{blurb}

Views

-'''.format(date=datetime.datetime.utcnow().date(), - title=config['meta']['title'], +'''.format(title=config['meta']['title'], blurb=config['meta']['blurb'], encoding=_ENCODING, inter_message_padding='0.25em', border_radius='0.5em'), - footer='\n\n', + footer='''
+

Generated: {date} courtesy of notmuch and notmuch-to-html. + + +'''.format(date=datetime.datetime.utcnow().date()) ) if args.list_views: for view in config['views']: print(view['title']) sys.exit(0) -elif args.get_query != None: - for view in config['views']: - if args.get_query == view['title']: - print(' and '.join(view['query'])) - sys.exit(0) else: # only import notmuch if needed import notmuch @@ -329,3 +354,12 @@ else: db = notmuch.Database(mode=notmuch.Database.MODE.READ_ONLY) page.write(database=db, views=config['views']) + +if (args.query): + print ('''To customize the output use 'notmuch-to-html --config=CONFIG_FILE' after +placing the following content into CONFIG_FILE (note that you can add +additional views with their own queries): + + +''', file=sys.stderr) + print (json.dumps(config, indent=4, separators=(',',':')), file=sys.stderr)