Skip to content

Commit 8943dc7

Browse files
committed
[#90] Use the same block for main sheet and sub sheets
Eventually we want to eliminate the idea of a main sheet entirely #96
1 parent 9b15771 commit 8943dc7

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

flattentool/input.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -152,17 +152,9 @@ def convert_types(self, in_dict):
152152

153153
def unflatten(self):
154154
main_sheet_by_ocid = OrderedDict()
155-
for line in self.get_main_sheet_lines():
156-
if all(x == '' for x in line.values()):
157-
continue
158-
root_id_or_none = line[self.root_id] if self.root_id else None
159-
if root_id_or_none not in main_sheet_by_ocid:
160-
main_sheet_by_ocid[root_id_or_none] = TemporaryDict('id')
161-
main_sheet_by_ocid[root_id_or_none].append(unflatten_main_with_parser(self.parser, line, self.timezone))
162-
163-
for sheet_name, lines in self.get_sub_sheets_lines():
164-
for i, line in enumerate(lines):
165-
lineno = i+1
155+
# Eventually we should get rid of the concept of a "main sheet entirely"
156+
for sheet_name, lines in [(self.main_sheet_name, self.get_main_sheet_lines())] + list(self.get_sub_sheets_lines()):
157+
for line in lines:
166158
if all(x == '' for x in line.values()):
167159
continue
168160
root_id_or_none = line[self.root_id] if self.root_id else None

0 commit comments

Comments
 (0)