summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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')