Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
self.append(vars(text).copy()) solution in Clear category for Text Editor by veky
class Text:
def __init__(self): self.restore(dict(contents='', font=None))
def restore(self, version): vars(self).update(version)
def write(self, text): self.contents += text
def set_font(self, font): self.font = font
def show(self):
fontrep = '' if self.font is None else self.font.join('[]')
return fontrep + self.contents + fontrep
class SavedText(list):
def save_text(self, text): self.append(vars(text).copy())
get_version = list.__getitem__
June 23, 2018
Comments: