From 2860232cc6a70894f8104474bcf8a3a861ac79ac Mon Sep 17 00:00:00 2001 From: mathieui Date: Fri, 13 May 2011 11:34:31 +0200 Subject: =?UTF-8?q?Fix=20a=20traceback=20on=20C-c=20=E2=9D=B6=20or=20C-c?= =?UTF-8?q?=20=C2=B2,=20etc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/windows.py | 4 ++-- src/xhtml.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/windows.py b/src/windows.py index 85584152..058f08ce 100644 --- a/src/windows.py +++ b/src/windows.py @@ -126,7 +126,7 @@ class Win(object): self._win.attron(curses.A_UNDERLINE) elif attr_char == 'b': self._win.attron(curses.A_BOLD) - elif attr_char.isnumeric(): + elif attr_char in string.digits: self._win.attron(common.curses_color_pair(int(attr_char))) next_attr_char = text.find('\x19') self.addstr(text) @@ -1125,7 +1125,7 @@ class MessageInput(Input): Read one more char (c) and add \x19c to the string """ attr_char = self.core.read_keyboard() - if attr_char in self.text_attributes or (attr_char.isnumeric() and int(attr_char) < 7): + if attr_char in self.text_attributes or (attr_char in string.digits and int(attr_char) < 7): self.do_command('\x19', False) self.do_command(attr_char) diff --git a/src/xhtml.py b/src/xhtml.py index 237ed444..d7ad522a 100644 --- a/src/xhtml.py +++ b/src/xhtml.py @@ -133,7 +133,7 @@ def poezio_colors_to_html(string): if 'strong' not in opened_elements: opened_elements.append('strong') res += '' - elif attr_char.isnumeric(): + elif attr_char in string.digits: number = int(attr_char) if number in number_to_color_names: if 'strong' in opened_elements: @@ -215,7 +215,7 @@ def poezio_colors_to_xhtml(string): if 'strong' not in open_elements: res += '' open_elements.append('strong') - elif attr_char.isnumeric(): + elif attr_char in string.digits: self._win.attron(common.curses_color_pair(int(attr_char))) next_attr_char = string.find('\x19') -- cgit v1.2.3