Parse a pattern-file line and act depending on which command it represents.
(line, roots, ie_commands, fallback)
| 12 | |
| 13 | |
| 14 | def parse_patternfile_line(line, roots, ie_commands, fallback): |
| 15 | """Parse a pattern-file line and act depending on which command it represents.""" |
| 16 | ie_command = parse_inclexcl_command(line, fallback=fallback) |
| 17 | if ie_command.cmd is IECommand.RootPath: |
| 18 | roots.append(ie_command.val) |
| 19 | elif ie_command.cmd is IECommand.PatternStyle: |
| 20 | fallback = ie_command.val |
| 21 | else: |
| 22 | # it is some kind of include/exclude command |
| 23 | ie_commands.append(ie_command) |
| 24 | return fallback |
| 25 | |
| 26 | |
| 27 | def load_pattern_file(fileobj, roots, ie_commands, fallback=None): |
no test coverage detected