A tool for printing from notmuch

Andreas Amann a.amann at ucc.ie
Fri Jan 28 12:59:06 PST 2011


Dear Jesse,


> Printing from notmuch is a bit of a pain. Muttprint doesn't really help
> much, because it can't handle multiparts well, doesn't know what to do
> with html, and will print out pages of base64 if you have
> attachments. And more often than not, what I need to print is an HTML
> email (a bus ticket or something).
> 
> A solution I've been working on for my own use is here:
> 
> http://commonmeasure.org/~jkr/notmuchprint

Thanks, that sounds great! I have been waiting for something like this
...

Unfortunately I could not get it to work with python2.7:

Traceback (most recent call last):
  File "/home/amann/local/bin/notmuchprint", line 284, in <module>
    main(config)
  File "/home/amann/local/bin/notmuchprint", line 238, in main
    VIEW_IN_BROWSER = config.getboolean('DEFAULT', 'view_in_browser')
  File "/usr/lib/python2.7/ConfigParser.py", line 360, in getboolean
    v = self.get(section, option)
  File "/usr/lib/python2.7/ConfigParser.py", line 581, in get
    return self._interpolate(section, option, value, d)
  File "/usr/lib/python2.7/ConfigParser.py", line 621, in _interpolate
    if value and "%(" in value:
TypeError: argument of type 'bool' is not iterable


is this a known problem, or am I missing something obvious? 

Next I commented out the offending line via 

    VIEW_IN_BROWSER = False


however still no luck:

Traceback (most recent call last):
  File "/home/amann/local/bin/notmuchprint", line 284, in <module>
    main(config)
  File "/home/amann/local/bin/notmuchprint", line 263, in main
    nm_msg = NotmuchMsg(msgid, config)
  File "/home/amann/local/bin/notmuchprint", line 58, in __init__
    self.json_thread = json.loads(json_string)
  File "/usr/lib/python2.7/json/__init__.py", line 326, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 360, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 378, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded



Any hints?

Andreas


More information about the notmuch mailing list