remove space in new_s==old_s if they are sting for explicable

This commit is contained in:
Lafrite 2015-04-17 16:38:16 +02:00
parent 3af50d0eab
commit 0e140cb304
1 changed files with 17 additions and 2 deletions

View File

@ -87,7 +87,7 @@ class Explicable(Renderable):
new_s = self.STR_RENDER(s.postfix_tokens) new_s = self.STR_RENDER(s.postfix_tokens)
else: else:
new_s = self.STR_RENDER(s) new_s = self.STR_RENDER(s)
if new_s != old_s: if not self.is_same_step(new_s, old_s):
old_s = new_s old_s = new_s
yield new_s yield new_s
except AttributeError: except AttributeError:
@ -96,9 +96,24 @@ class Explicable(Renderable):
if noself: if noself:
# Lui même # Lui même
new_s = self.STR_RENDER(self.postfix_tokens) new_s = self.STR_RENDER(self.postfix_tokens)
if new_s != old_s: if not self.is_same_step(new_s, old_s):
yield new_s yield new_s
def is_same_step(self, new, old):
"""Return whether the new step is the same than old step
"""
try:
if new.replace(" ", "") == old.replace(" ", ""):
return True
else:
return False
except AttributeError:
if new == old:
return True
else:
return False