summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2011-05-13 11:46:50 +0200
committermathieui <mathieui@mathieui.net>2011-05-13 11:46:50 +0200
commit3d43517a41dfd568400cffb2e7b480cec315498f (patch)
tree714ca365753e8866d5647a17f99cbd05974eb00a /src
parent2860232cc6a70894f8104474bcf8a3a861ac79ac (diff)
downloadpoezio-3d43517a41dfd568400cffb2e7b480cec315498f.tar.gz
poezio-3d43517a41dfd568400cffb2e7b480cec315498f.tar.bz2
poezio-3d43517a41dfd568400cffb2e7b480cec315498f.tar.xz
poezio-3d43517a41dfd568400cffb2e7b480cec315498f.zip
Don’t break xhtml-im
Diffstat (limited to 'src')
-rw-r--r--src/windows.py6
-rw-r--r--src/xhtml.py5
2 files changed, 8 insertions, 3 deletions
diff --git a/src/windows.py b/src/windows.py
index 058f08ce..75b08961 100644
--- a/src/windows.py
+++ b/src/windows.py
@@ -566,7 +566,11 @@ class TextWin(Win):
else:
txt = txt.replace('\t', ' ')
# length of the time
- offset = 9+len(theme.CHAR_TIME_LEFT[:1])+len(theme.CHAR_TIME_RIGHT[:1])
+ offset = 9
+ if theme.CHAR_TIME_RIGHT:
+ offset += 1
+ if theme.CHAR_TIME_RIGHT:
+ offset += 1
nickname = message.nickname
if nickname and len(nickname) >= 25:
nick = nickname[:25]+'…'
diff --git a/src/xhtml.py b/src/xhtml.py
index d7ad522a..29017be3 100644
--- a/src/xhtml.py
+++ b/src/xhtml.py
@@ -28,6 +28,7 @@ import subprocess
from sleekxmpp.xmlstream import ET
from xml.etree.ElementTree import ElementTree
from sys import version_info
+from string import digits
from config import config
import logging
@@ -133,7 +134,7 @@ def poezio_colors_to_html(string):
if 'strong' not in opened_elements:
opened_elements.append('strong')
res += '<strong>'
- elif attr_char in string.digits:
+ elif attr_char in digits:
number = int(attr_char)
if number in number_to_color_names:
if 'strong' in opened_elements:
@@ -215,7 +216,7 @@ def poezio_colors_to_xhtml(string):
if 'strong' not in open_elements:
res += '<strong>'
open_elements.append('strong')
- elif attr_char in string.digits:
+ elif attr_char in digits:
self._win.attron(common.curses_color_pair(int(attr_char)))
next_attr_char = string.find('\x19')