iterglob_infos_incl_excl#

barecat.Index.iterglob_infos_incl_excl(rules, default_include=True, only_files=False, bufsize=None)[source]#

Iterate over infos matching rsync-style include/exclude rules.

Uses “first match wins” semantics like rsync: each file is tested against rules in order, and the first matching rule determines inclusion/exclusion.

Parameters:
  • rules (list[tuple[str, str]]) – List of (sign, pattern) tuples. sign is ‘+’ for include, ‘-’ for exclude. Patterns use Python glob syntax with ** support.

  • default_include (bool) – If no rule matches, include (True) or exclude (False).

  • only_files (bool) – Whether to return only files, not directories.

  • bufsize (Optional[int]) – Buffer size for fetching rows.

Returns:

An iterator over matching file/directory info objects.

Return type:

Iterator[barecat.core.types.BarecatEntryInfo]