X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=devel%2Fnmbug%2Fnmbug-status;h=6b2572c18ccbdb71cd40003b90e753e7e20e8313;hb=18d71908b2d2d5843d38ec94cf2daf5f1e8ecd29;hp=1c390e6d391de3a71c510a759d9e11e8e90be9dc;hpb=aaa7f0d92ee9c876c38da43be5c49e8d5c73a99b;p=notmuch diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status index 1c390e6d..6b2572c1 100755 --- a/devel/nmbug/nmbug-status +++ b/devel/nmbug/nmbug-status @@ -13,7 +13,6 @@ import codecs import collections import datetime import email.utils -import locale try: # Python 3 from urllib.parse import quote except ImportError: # Python 2 @@ -27,7 +26,7 @@ import subprocess import xml.sax.saxutils -_ENCODING = locale.getpreferredencoding() or sys.getdefaultencoding() +_ENCODING = 'UTF-8' _PAGES = {} @@ -42,7 +41,7 @@ if not hasattr(collections, 'OrderedDict'): # Python 2.6 or earlier super(_OrderedDict, self).__setitem__(key, value) self._keys.append(key) - def __values__(self): + def values(self): for key in self._keys: yield self[key] @@ -90,7 +89,7 @@ class Page (object): byte_stream = sys.stdout.buffer except AttributeError: # Python 2 byte_stream = sys.stdout - stream = codecs.getwriter(encoding='UTF-8')(stream=byte_stream) + stream = codecs.getwriter(encoding=_ENCODING)(stream=byte_stream) self._write_header(views=views, stream=stream) for view in views: self._write_view(database=database, view=view, stream=stream) @@ -205,19 +204,22 @@ class HtmlPage (Page): return stream.write('
{date} | \n' - '{message-id-term} | \n'
- '
{from} | \n' - '{subject} | \n' - '