mirror of
https://github.com/borgbackup/borg.git
synced 2025-01-01 04:37:34 +00:00
load_excludes: reuse existing clean_lines function
This commit is contained in:
parent
18263f6257
commit
ee8f753946
1 changed files with 1 additions and 2 deletions
|
@ -282,8 +282,7 @@ def load_excludes(fh):
|
||||||
"""Load and parse exclude patterns from file object. Lines empty or starting with '#' after stripping whitespace on
|
"""Load and parse exclude patterns from file object. Lines empty or starting with '#' after stripping whitespace on
|
||||||
both line ends are ignored.
|
both line ends are ignored.
|
||||||
"""
|
"""
|
||||||
patterns = (line for line in (i.strip() for i in fh) if not line.startswith('#'))
|
return [parse_pattern(pattern) for pattern in clean_lines(fh)]
|
||||||
return [parse_pattern(pattern) for pattern in patterns if pattern]
|
|
||||||
|
|
||||||
|
|
||||||
def update_excludes(args):
|
def update_excludes(args):
|
||||||
|
|
Loading…
Reference in a new issue