Fix linting issues

Fixes linting issues that caused the `flake8` CI stage to fail.
This commit is contained in:
John Franey 2019-02-06 10:22:57 -04:00
commit 3395e71570
5 changed files with 33 additions and 30 deletions

View file

@ -81,9 +81,9 @@ def main():
to_sym = args.to_symlink or args.clean to_sym = args.to_symlink or args.clean
if args.action: if args.action:
if args.action is 'list': if args.action == 'list':
list_themes(args.verbose) list_themes(args.verbose)
elif args.action is 'path': elif args.action == 'path':
print(_THEMES_PATH) print(_THEMES_PATH)
elif to_install or args.to_remove or to_sym: elif to_install or args.to_remove or to_sym:
if args.to_remove: if args.to_remove:

View file

@ -787,8 +787,11 @@ def folder_watcher(path, extensions, ignores=[]):
dirs[:] = [x for x in dirs if not x.startswith(os.curdir)] dirs[:] = [x for x in dirs if not x.startswith(os.curdir)]
for f in files: for f in files:
if f.endswith(tuple(extensions)) and \ valid_extension = f.endswith(tuple(extensions))
not any(fnmatch.fnmatch(f, ignore) for ignore in ignores): file_ignored = any(
fnmatch.fnmatch(f, ignore) for ignore in ignores
)
if valid_extension and not file_ignored:
try: try:
yield os.stat(os.path.join(root, f)).st_mtime yield os.stat(os.path.join(root, f)).st_mtime
except OSError as e: except OSError as e: