1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 19:09:44 +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 name in names:
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
whitelist.add(name)
elif fnmatch.fnmatch(path, ignore):

View File

@@ -204,7 +204,8 @@ def must_ignore(paths, ignores, debug=False):
return False
if debug:
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:
ignore_matches = []
# First ignore dotfiles
@@ -387,5 +388,5 @@ def categorize(function, iterable):
function(element) is true for each element and
for which function(element) is false for each
element"""
return tuple(filter(function, iterable)),\
tuple(itertools.filterfalse(function, iterable))
return (tuple(filter(function, iterable)),
tuple(itertools.filterfalse(function, iterable)))