SegmentParser now stores ref to segment data so it can reparse without having to pass that in again

This commit is contained in:
Rob McMullen 2017-03-19 13:07:19 -07:00
parent da7c7830bb
commit a7b24e705e

View File

@ -21,9 +21,11 @@ class SegmentParser(object):
self.image = None self.image = None
self.segments = [] self.segments = []
self.strict = strict self.strict = strict
self.parse(segment_data) self.segment_data = segment_data
self.parse()
def parse(self, r): def parse(self):
r = self.segment_data
self.segments.append(DefaultSegment(r, 0)) self.segments.append(DefaultSegment(r, 0))
try: try:
self.image = self.get_image(r) self.image = self.get_image(r)
@ -51,8 +53,8 @@ class SegmentParser(object):
class DefaultSegmentParser(SegmentParser): class DefaultSegmentParser(SegmentParser):
menu_name = "Raw Data" menu_name = "Raw Data"
def parse(self, r): def parse(self):
self.segments = [DefaultSegment(r, 0)] self.segments = [DefaultSegment(self.segment_data, 0)]
class KBootSegmentParser(SegmentParser): class KBootSegmentParser(SegmentParser):