10 Jul
2022
10 Jul
'22
2:09 p.m.
class Data: def __init__(self, offset, data, end = None): self.start = offset self.data = data if end is None: self.end = self.start + len(self.data) class Flush: def __init__(self, parent = None): self.parent = parent if self.parent is not None: self.index = [self.parent] # this should expand self.parent if it's too deep, and shallow it if there is only one child else: self.index = [] def write(self, offset, data): # 1. trim index to left and right of data # 2. remove items in between and replace with data