mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Fix linting issues
Fixes linting issues that caused the `flake8` CI stage to fail.
This commit is contained in:
parent
95a6486a8b
commit
3395e71570
5 changed files with 33 additions and 30 deletions
|
|
@ -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:
|
||||||
|
|
|
||||||
|
|
@ -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:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue