notmuch/devel
W. Trevor King 98cb4779c0 nmbug-status: Add Page and HtmlPage for modular rendering
I was having trouble understanding the logic of the longish print_view
function, so I refactored the output generation into modular bits.
The basic text rendering is handled by Page, which has enough hooks
that HtmlPage can borrow the logic and slot-in HTML generators.

By modularizing the logic it should also be easier to build other
renderers if folks want to customize the layout for other projects.

Timezones
=========

This commit has not effect on the output, except that some dates have
been converted from the sender's timezone to UTC due to:

  -            val = m.get_header(header)
  -            ...
  -            if header == 'date':
  -                val = str.join(' ', val.split(None)[1:4])
  -                val = str(datetime.datetime.strptime(val, '%d %b %Y').date())
  ...
  +                value = str(datetime.datetime.utcfromtimestamp(
  +                    message.get_date()).date())

I also tweaked the HTML header date to be utcnow instead of the local
now() to make all times independent of the generator's local time.
This matches Gmane, which converts all Date headers to UTC (although
they use a 'GMT' suffix).  Notmuch uses
g_mime_utils_header_decode_date to calculate the UTC timestamps, but
uses a NULL tz_offset which drops the information we'd need to get
back to the sender's local time [1].  With the generator's local time
arbitrarily different from the sender's and viewer's local time,
sticking with UTC seems the best bet.

[1]: https://developer.gnome.org/gmime/stable/gmime-gmime-utils.html#g-mime-utils-header-decode-date
2014-02-10 22:51:03 -04:00
..
nmbug nmbug-status: Add Page and HtmlPage for modular rendering 2014-02-10 22:51:03 -04:00
doxygen.cfg devel: add doxygen configuration file 2014-01-05 08:59:52 -04:00
man-to-mdwn.pl devel: add post-release tools news2wiki.pl and man-to-mdwn.pl 2013-03-29 09:23:19 -04:00
news2wiki.pl devel: add post-release tools news2wiki.pl and man-to-mdwn.pl 2013-03-29 09:23:19 -04:00
printmimestructure devel: add dkg's printmimestructure script to notmuch devel scripts 2013-05-23 08:01:37 -03:00
release-checks.sh devel/release-checks.sh: adjust to LIBNOTMUCH version checks 2013-12-30 20:39:25 -04:00
RELEASING Start devel directory for developer tools and documentation. 2012-01-17 22:53:31 -04:00
schemata search: Add stable queries to thread search results 2013-11-08 20:43:29 -04:00
STYLE devel/STYLE: information how to enable standard pre-commit hook 2013-03-29 09:21:44 -04:00
TODO emacs: Fix search tagging races 2013-11-08 20:52:00 -04:00
uncrustify.cfg uncrustify.cfg: added 3 new types for uncrustify to know 2012-11-07 08:00:03 -04:00