self.generator for explicable

This commit is contained in:
Benjamin Bertrand 2016-03-15 12:12:56 +03:00
parent 6ca6cff6e2
commit f74f41c131

View File

@ -47,11 +47,15 @@ class Explicable(Renderable):
"""
if self.explained:
return [self.STR_RENDER(self.postfix_tokens)]
return self.self_generator()
else:
self.explained = 1
return self.history_generator()
def self_generator(self):
""" Generator which yield itself rendered """
yield self.STR_RENDER(self.postfix_tokens)
def history_generator(self):
r""" Generator for rendered steps which leed to itself