Contents

Pathspec library internals

0

This page is all about the pathspec python library, the contents below is auto-generated by inspecting a python package’s code base.

This page is experimental: if you are seeking help with the `pathspec` python package it's usually best to reference the libraries offical documentation page.

Package Files

  • pathspec/__init__.py
  • pathspec/_meta.py
  • pathspec/compat.py
  • pathspec/pathspec.py
  • pathspec/pattern.py
  • pathspec/patterns
  • pathspec/patterns/__init__.py
  • pathspec/patterns/gitwildmatch.py
  • pathspec/tests
  • pathspec/tests/__init__.py
  • pathspec/tests/test_gitwildmatch.py
  • pathspec/tests/test_pathspec.py
  • pathspec/tests/test_util.py
  • pathspec/util.py

Package Classes

N/A

Package Methods

pathspec.iter_tree()

root (:class:str) is the root directory to search for files.

on_error (:class:~collections.abc.Callable or :data:None) optionally is the error handler for file-system exceptions. It will be called with the exception (:exc:OSError). Reraise the exception to abort the walk. Default is :data:None to ignore file-system exceptions.

follow_links (:class:bool or :data:None) optionally is whether to walk symbolic links that resolve to directories. Default is

pathspec.iter_tree(root, on_error=None, follow_links=None)

pathspec.iter_tree(
  root,
  on_error,
  follow_links,
)

pathspec.lookup_pattern()

name (:class:str) is the name of the pattern factory.

Returns the registered pattern factory (:class:~collections.abc.Callable). If no pattern factory is registered, raises :exc:KeyError.

pathspec.lookup_pattern(name)

pathspec.lookup_pattern(
  name,
)

pathspec.match_files()

patterns (:class:~collections.abc.Iterable of :class:~pathspec.pattern.Pattern) contains the patterns to use.

files (:class:~collections.abc.Iterable of :class:str) contains the normalized file paths to be matched against patterns.

Returns the matched files (:class:set of :class:str).

pathspec.match_files(patterns, files)

pathspec.match_files(
  patterns,
  files,
)