MCPcopy
hub / github.com/borgbackup/borg / parse_patternfile_line

Function parse_patternfile_line

src/borg/patterns.py:14–24  ·  view source on GitHub ↗

Parse a pattern-file line and act depending on which command it represents.

(line, roots, ie_commands, fallback)

Source from the content-addressed store, hash-verified

12
13
14def 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
27def load_pattern_file(fileobj, roots, ie_commands, fallback=None):

Callers 2

load_pattern_fileFunction · 0.85
__call__Method · 0.85

Calls 1

parse_inclexcl_commandFunction · 0.85

Tested by

no test coverage detected