Remove color codes from topic

This commit is contained in:
Sebastien Helleu 2011-12-24 13:17:31 +01:00
parent 773ee7bb73
commit 54bcac1f1b
2 changed files with 7 additions and 6 deletions

View file

@ -28,6 +28,7 @@ QtCore = qt_compat.import_module('QtCore')
QtGui = qt_compat.import_module('QtGui')
from chat import ChatTextEdit
from input import InputLineEdit
import weechat.color as color
class GenericListWidget(QtGui.QListWidget):
@ -161,7 +162,7 @@ class Buffer(QtCore.QObject):
def update_title(self):
"""Update title."""
try:
self.widget.set_title(self.data['title'])
self.widget.set_title(color.remove(self.data['title']))
except:
self.widget.set_title(None)

View file

@ -163,8 +163,8 @@ class Color():
else:
return RE_COLOR.sub(self._convert_color, text)
def remove(self, text):
"""Remove colors in a WeeChat string."""
if not text:
return ''
return re.sub(RE_COLOR, '', text)
def remove(text):
"""Remove colors in a WeeChat string."""
if not text:
return ''
return re.sub(RE_COLOR, '', text)