瀏覽代碼

flake8 beautifications

Alexander 'Leo' Bergolth 8 年之前
父節點
當前提交
3fdc631064
共有 3 個文件被更改,包括 4 次插入5 次删除
  1. 1 1
      borg/archiver.py
  2. 1 0
      borg/helpers.py
  3. 2 4
      borg/testsuite/helpers.py

+ 1 - 1
borg/archiver.py

@@ -895,7 +895,7 @@ class Archiver:
     helptext = collections.OrderedDict()
     helptext['patterns'] = textwrap.dedent('''
         File patterns support four separate styles, fnmatch, shell, regular
-        expressions and path prefixes. By default, fnmatch is used for 
+        expressions and path prefixes. By default, fnmatch is used for
         `--exclude` patterns and shell-style is used for `--pattern`. If followed
         by a colon (':') the first two characters of a pattern are used as a
         style selector. Explicit style selection is necessary when a

+ 1 - 0
borg/helpers.py

@@ -518,6 +518,7 @@ _PATTERN_STYLE_BY_PREFIX = dict((i.PREFIX, i) for i in _PATTERN_STYLES)
 InclExclPattern = namedtuple('InclExclPattern', 'pattern ptype')
 RootPath = object()
 
+
 def parse_pattern(pattern, fallback=FnmatchPattern):
     """Read pattern from string and return an instance of the appropriate implementation class.
     """

+ 2 - 4
borg/testsuite/helpers.py

@@ -462,7 +462,6 @@ def test_exclude_patterns_from_file(tmpdir, lines, expected):
 ])
 def test_load_patterns_from_file(tmpdir, lines, expected_roots, expected_numpatterns):
     def evaluate(filename):
-        matcher = PatternMatcher(fallback=True)
         roots, inclexclpatterns = load_patterns(open(filename, "rt"))
         return roots, len(inclexclpatterns)
     patternfile = tmpdir.join("exclude.txt")
@@ -476,8 +475,8 @@ def test_load_patterns_from_file(tmpdir, lines, expected_roots, expected_numpatt
 
 
 @pytest.mark.parametrize("lines", [
-    (["X /data"]), # illegal pattern type prefix
-    (["/data"]), # need a pattern type prefix
+    (["X /data"]),  # illegal pattern type prefix
+    (["/data"]),    # need a pattern type prefix
 ])
 def test_load_invalid_patterns_from_file(tmpdir, lines):
     patternfile = tmpdir.join("exclude.txt")
@@ -485,7 +484,6 @@ def test_load_invalid_patterns_from_file(tmpdir, lines):
         fh.write("\n".join(lines))
     filename = str(patternfile)
     with pytest.raises(argparse.ArgumentTypeError):
-        matcher = PatternMatcher(fallback=True)
         roots, inclexclpatterns = load_patterns(open(filename, "rt"))