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

Method __call__

src/borg/patterns.py:51–60  ·  view source on GitHub ↗

Load and parse patterns from a file. Lines empty or starting with '#' after stripping whitespace on both line ends are ignored.

(self, parser, args, values, option_string=None)

Source from the content-addressed store, hash-verified

49 super().__init__(nargs=nargs, **kw)
50
51 def __call__(self, parser, args, values, option_string=None):
52 """Load and parse patterns from a file.
53 Lines empty or starting with '#' after stripping whitespace on both line ends are ignored.
54 """
55 filename = values[0]
56 try:
57 with open(filename) as f:
58 self.parse(f, args)
59 except FileNotFoundError as e:
60 raise Error(str(e))
61
62 def parse(self, fobj, args):
63 load_pattern_file(fobj, args.pattern_roots, args.patterns)

Callers

nothing calls this directly

Calls 2

parseMethod · 0.95
ErrorClass · 0.85

Tested by

no test coverage detected