Skip to content

Commit

Permalink
feat: allow custom folder glob for casebase import
Browse files Browse the repository at this point in the history
  • Loading branch information
mirkolenz committed Jan 30, 2023
1 parent 634fad1 commit 08f07fe
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions arguebuf/converters/from_casebase.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def from_casebase(
basepath: t.Union[Path, str],
include: t.Union[CasebaseFilter, t.Iterable[CasebaseFilter]],
# exclude: t.Union[CasebaseFilter, t.Iterable[CasebaseFilter], None] = None,
basepath_glob: str = "*/*",
config: ConverterConfig = DefaultConverter,
strict_equal: bool = False,
):
Expand All @@ -95,8 +96,13 @@ def from_casebase(
# exclude = [exclude]

for filter in include:
for path in sorted(basepath.glob("*/*")):
if path.is_dir() and filter.name.match(path.parent.name):
for path in sorted(basepath.glob(basepath_glob)):
if (
path.is_dir()
and filter.name.match(path.parent.name)
and not path.parent.name.startswith(".")
and not path.name.startswith(".")
):
graphs.update(_from_casebase_single(filter, path, config, strict_equal))

return graphs
Expand Down

0 comments on commit 08f07fe

Please sign in to comment.