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