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:
@@ -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):
|
||||
|
||||
@@ -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)))
|
||||
|
||||
Reference in New Issue
Block a user