1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-12 10:43:30 +00:00

Reformat updater.py and utils.py to match pycodestyle

This commit is contained in:
Joey Territo
2020-12-22 21:56:00 -05:00
parent 963a848b2b
commit 0c0acdd843
2 changed files with 6 additions and 4 deletions

View File

@@ -281,7 +281,8 @@ class Updater:
for ignore in self.ignores: for ignore in self.ignores:
for name in names: for name in names:
path = os.path.join(src, name) path = os.path.join(src, name)
if ignore.startswith('!') and fnmatch.fnmatch(path, ignore[1:]): if ignore.startswith('!') and \
fnmatch.fnmatch(path, ignore[1:]):
# add to whitelist # add to whitelist
whitelist.add(name) whitelist.add(name)
elif fnmatch.fnmatch(path, ignore): elif fnmatch.fnmatch(path, ignore):

View File

@@ -204,7 +204,8 @@ def must_ignore(paths, ignores, debug=False):
return False return False
if debug: if debug:
LOG.dbg('must ignore? \"{}\" against {}'.format(paths, ignores)) LOG.dbg('must ignore? \"{}\" against {}'.format(paths, ignores))
ignored_negative, ignored = categorize(lambda ign: ign.startswith('!'), ignores) ignored_negative, ignored = categorize(
lambda ign: ign.startswith('!'), ignores)
for p in paths: for p in paths:
ignore_matches = [] ignore_matches = []
# First ignore dotfiles # First ignore dotfiles
@@ -387,5 +388,5 @@ def categorize(function, iterable):
function(element) is true for each element and function(element) is true for each element and
for which function(element) is false for each for which function(element) is false for each
element""" element"""
return tuple(filter(function, iterable)),\ return (tuple(filter(function, iterable)),
tuple(itertools.filterfalse(function, iterable)) tuple(itertools.filterfalse(function, iterable)))