Ignore the __pycache__ folder in diagnosis hook folder

This commit is contained in:
Alexandre Aubin 2021-01-01 05:04:33 +01:00
parent cce020daac
commit d5da3d899a

View file

@ -182,7 +182,8 @@ def hook_list(action, list_by='name', show_info=False):
def _append_folder(d, folder):
# Iterate over and add hook from a folder
for f in os.listdir(folder + action):
if f[0] == '.' or f[-1] == '~' or f.endswith(".pyc"):
if f[0] == '.' or f[-1] == '~' or f.endswith(".pyc") \
or (f.startswith("__") and f.endswith("__")):
continue
path = '%s%s/%s' % (folder, action, f)
priority, name = _extract_filename_parts(f)