parse.py

changeset 29
db6ca177c6c4
parent 19
9169bad392c4
child 35
865cd526e8b6
child 41
4d87bc126368
equal deleted inserted replaced
28:5933250813a3 29:db6ca177c6c4
5 5
6 class BadLdrawLine(Exception): 6 class BadLdrawLine(Exception):
7 pass 7 pass
8 8
9 def parse_ldraw_code(line): 9 def parse_ldraw_code(line):
10 if isinstance(line, bytes):
11 line = line.decode()
10 line = line.strip() 12 line = line.strip()
11 if not line: 13 if not line:
12 return linetypes.EmptyLine() 14 return linetypes.EmptyLine()
13 elif line == '0': 15 elif line == '0':
14 return linetypes.Comment('') 16 return linetypes.Comment('')

mercurial