header.py

changeset 76
c73432653fd9
parent 69
a24c4490d9f2
child 77
d98502ae1f33
equal deleted inserted replaced
75:3ec747dfbfb9 76:c73432653fd9
102 self.skip_to_next() 102 self.skip_to_next()
103 result.description = self.current() 103 result.description = self.current()
104 self.skip_to_next() 104 self.skip_to_next()
105 result.name = self.parse_pattern(r'^Name: (.+)$', 'name')[0] 105 result.name = self.parse_pattern(r'^Name: (.+)$', 'name')[0]
106 self.skip_to_next() 106 self.skip_to_next()
107 result.author, result.username = self.parse_pattern(r'^Author: ([^ \[]*[^\[]+) (?:\[([^\]]+)\])?', 'author') 107 result.author, result.username = self.parse_pattern(r'^Author: (?:([^ \[]*[^\[]+) )?(?:\[([^\]]+)\])?', 'author')
108 if not result.author and not result.username:
109 self.parse_error('author line does not contain a name nor username')
108 for header_entry in self.get_more_header_stuff(): 110 for header_entry in self.get_more_header_stuff():
109 if self.try_to_match( 111 if self.try_to_match(
110 r'^!LDRAW_ORG ' \ 112 r'^!LDRAW_ORG ' \
111 r'((?:Unofficial_)?(?:' \ 113 r'((?:Unofficial_)?(?:' \
112 r'Part|' \ 114 r'Part|' \

mercurial