# searches, (with links to gmane views of each email if available).
#
# Copyright (c) 2011-2012 David Bremner <david@tethera.net>
+# Copyright (c) 2014 Carl Worth <cworth@cworth.org
#
# dependencies
# - python 2.6 for json
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')
args = parser.parse_args()
encoding=_ENCODING,
inter_message_padding='0.25em',
border_radius='0.5em'),
- footer='<hr><p>Generated: {date}</body>\n</html>\n'.format(date=datetime.datetime.utcnow().date())
+ footer='''<hr>
+<p>Generated: {date} courtesy of <a href="http://notmuchmail.org">notmuch</a> and <a href="http://git.cworth.org/git/notmuch-to-html">notmuch-to-html</a>.
+</body>
+</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
if (args.query):
print ('''To customize the output use 'notmuch-to-html --config=CONFIG_FILE' after
-placing the following content into CONFIG_FILE:
+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)