From 4b6fbded970444e2b130d4a44e9d0853a7c5ec74 Mon Sep 17 00:00:00 2001 From: pazz Date: Fri, 15 Jul 2011 11:05:39 +0100 Subject: unicode prompts urwid.Edit().get_text() converts input to unicode iff its text arg was a unicode obj. partly fixes issue #46 --- alot/widgets.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'alot/widgets.py') diff --git a/alot/widgets.py b/alot/widgets.py index a95ad1da..bee616fc 100644 --- a/alot/widgets.py +++ b/alot/widgets.py @@ -129,9 +129,11 @@ class TagWidget(urwid.Text): class PromptWidget(urwid.AttrMap): - def __init__(self, prefix, text='', completer=None): + def __init__(self, prefix, text=u'', completer=None): self.completer = completer leftpart = urwid.Text(prefix, align='left') + if not isinstance(text,unicode): + text = unicode(text, errors='replace') self.editpart = urwid.Edit(edit_text=text) self.start_completion_pos = len(text) self.completion_results = None -- cgit v1.2.3