Commit 9f5d35f2 authored by Sebastien Petitdemange's avatar Sebastien Petitdemange

Merge branch 'issue-598' into 'master'

Issue 598: ignore .git directory in beacon db_path, and '~' files (TO BE MERGED AFTER !1099)

Closes #598

See merge request !1100
parents 774b5e38 a29361d7
Pipeline #8440 passed with stages
in 19 minutes and 46 seconds
......@@ -408,9 +408,11 @@ def __get_directory_structure(base_dir):
result = {}
base_dir = base_dir.rstrip(os.sep)
start = base_dir.rfind(os.sep) + 1
for path, dirs, files in os.walk(base_dir, followlinks=True):
for path, dirs, files in os.walk(base_dir, followlinks=True, topdown=True):
# with topdown=True, the search can be pruned by altering 'dirs'
dirs[:] = [d for d in dirs if d not in (".git",)]
folders = path[start:].split(os.sep)
subdir = dict.fromkeys(files)
subdir = dict.fromkeys((f for f in files if "~" not in f))
parent = reduce(dict.get, folders[:-1], result)
parent[folders[-1]] = subdir
assert len(result) == 1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment