From 04856cd5c99e07b3f5cf33e1dd8d767c92575608 Mon Sep 17 00:00:00 2001 From: mzfr Date: Mon, 15 Oct 2018 23:02:24 +0530 Subject: [PATCH] Ignore hidden files and folders --- kodi_addon_checker/handle_files.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kodi_addon_checker/handle_files.py b/kodi_addon_checker/handle_files.py index 4d70457e..acab878a 100644 --- a/kodi_addon_checker/handle_files.py +++ b/kodi_addon_checker/handle_files.py @@ -46,10 +46,14 @@ def create_file_index(path: str): """ file_index = [] for root, folders, files in os.walk(path, topdown=True): + if ".directory" in files: + files.remove(".directory") if ".git" in folders: folders.remove(".git") for file_name in files: - file_index.append({"path": root, "name": file_name}) + if not os.path.basename(root).startswith("."): + file_index.append({"path": root, "name": file_name}) + return file_index