diff options
author | pazz <patricktotzke@gmail.com> | 2011-07-09 21:21:40 +0100 |
---|---|---|
committer | pazz <patricktotzke@gmail.com> | 2011-07-09 21:21:40 +0100 |
commit | 0d91066cc81a7b61463de641ccb3cebe6ac5f16b (patch) | |
tree | 148493a7c56db513e0354ef878608edcd860b2c4 /alot | |
parent | 78b9fff655b3fd7daa1eed60bde60b842eb33203 (diff) |
unicode strings in helpers
Diffstat (limited to 'alot')
-rw-r--r-- | alot/helper.py | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/alot/helper.py b/alot/helper.py index 370b2315..acfe6722 100644 --- a/alot/helper.py +++ b/alot/helper.py @@ -31,16 +31,15 @@ def shorten(string, maxlen): def pretty_datetime(d): - string = "" today = date.today() if today == d.date(): - string = d.strftime('%H:%M%P') + string = unicode(d.strftime('%H:%M%P')) elif d.date() == today - timedelta(1): - string = 'Yest.%2d' % d.hour + d.strftime('%P') + string = unicode('Yest.%2d' % d.hour + d.strftime('%P')) elif d.year != today.year: - string = d.strftime('%b %Y') + string = unicode(d.strftime('%b %Y')) else: - string = d.strftime('%b %d') + string = unicode(d.strftime('%b %d')) return string @@ -52,8 +51,4 @@ def cmd_output(command_line): return None except OSError: return None - return output - - -def parse_addr(addr): - return email.Utils.parseaddr(addr) + return unicode(output) |