diff --git a/swh/model/from_disk.py b/swh/model/from_disk.py --- a/swh/model/from_disk.py +++ b/swh/model/from_disk.py @@ -1,4 +1,4 @@ -# Copyright (C) 2017-2018 The Software Heritage developers +# Copyright (C) 2017-2020 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information @@ -196,7 +196,7 @@ return DiskBackedContent.from_dict(data) -def accept_all_directories(dirname, entries): +def accept_all_directories(dirname, entries, *args): """Default filter for :func:`Directory.from_disk` accepting all directories @@ -207,7 +207,7 @@ return True -def ignore_empty_directories(dirname, entries): +def ignore_empty_directories(dirname, entries, *args): """Filter for :func:`directory_to_objects` ignoring empty directories Args: @@ -282,7 +282,6 @@ max_content_length (Optional[int]): if given, all contents larger than this will be skipped. """ - top_path = path dirs = {} @@ -297,7 +296,7 @@ path=path, max_content_length=max_content_length) entries[name] = content else: - if dir_filter(name, dirs[path].entries): + if dir_filter(name, dirs[path].entries, path): entries[name] = dirs[path] dirs[root] = cls({'name': os.path.basename(root)})