Skip to content

Commit

Permalink
Merge pull request #3 from majora2007/bugfix/empty-cells
Browse files Browse the repository at this point in the history
Fixed empty cells causing issues for generation.
  • Loading branch information
majora2007 committed May 22, 2020
2 parents fd67ea1 + 693252b commit d3778d2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,21 @@ def load_file(self, data_file):


header = lines[0].split('|')
print(header)

for item in header:
self.types[item] = None

line_data = []
for line in lines[1:]:
line_data = [c for c in line.split('|') if c != '' and c != ' ']
line_data = [c for c in line.split('|')]
if len(line_data) is len(lines[0]):
break # TODO: Is there a better way to handle this?
break

for idx, cell in enumerate(line_data):
self.types[header[idx]] = self.parser.parse_type(cell), camel_case(header[idx])

#print(self.types)

self._pretty_print_types()

def generate_entity_files(self, entity_name, folder_path, create_typescript=False):
Expand Down

0 comments on commit d3778d2

Please sign in to comment.