Sun, 10 Dec 2017 15:46:47 +0200
Moved the parsing function into a new file
0 | 1 | #!/usr/bin/env python3 |
2 | 2 | from parse import parse_ldraw_code |
0 | 3 | |
4 | def read_ldraw(file, *, libraries): | |
5 | result = list() | |
6 | for line in file: | |
7 | result.append(parse_ldraw_code(line)) | |
8 | return result | |
9 | ||
10 | if __name__ == '__main__': | |
11 | from sys import argv | |
12 | libraries = [{'path': '/home/teemu/ldraw', 'role': 'official'}] | |
13 | with open(argv[1], 'r') as file: | |
14 | model = read_ldraw(file, libraries = libraries) | |
15 | from pprint import pprint | |
16 | pprint(model) |