Fixes #465. Issues with translation method should be resolved.

This commit is contained in:
Kelketek Rritaa 2014-01-30 20:36:51 -06:00
parent 93eba9d7a9
commit 382bf01bef

View file

@ -370,8 +370,8 @@ class ANSIString(unicode):
self.parser = kwargs.pop('parser', ANSI_PARSER) self.parser = kwargs.pop('parser', ANSI_PARSER)
super(ANSIString, self).__init__(*args, **kwargs) super(ANSIString, self).__init__(*args, **kwargs)
self.raw_string = unicode(self) self.raw_string = unicode(self)
self.clean_string = self.parser.parse_ansi( self.clean_string = unicode(self.parser.parse_ansi(
self.raw_string, strip_ansi=True) self.raw_string, strip_ansi=True))
self._code_indexes, self._char_indexes = self._get_indexes() self._code_indexes, self._char_indexes = self._get_indexes()
def __len__(self): def __len__(self):
@ -554,7 +554,7 @@ def _transform(func_name):
with the resulting string. with the resulting string.
""" """
def wrapped(self, *args, **kwargs): def wrapped(self, *args, **kwargs):
replacement_string = _query_super(func_name)(*args, **kwargs) replacement_string = _query_super(func_name)(self, *args, **kwargs)
to_string = [] to_string = []
for index in range(0, len(self.raw_string)): for index in range(0, len(self.raw_string)):
if index in self._code_indexes: if index in self._code_indexes: