__init__.py 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. """
  2. The *pathspec* package provides pattern matching for file paths. So far
  3. this only includes Git's wildmatch pattern matching (the style used for
  4. ".gitignore" files).
  5. The following classes are imported and made available from the root of
  6. the `pathspec` package:
  7. - :class:`pathspec.gitignore.GitIgnoreSpec`
  8. - :class:`pathspec.pathspec.PathSpec`
  9. - :class:`pathspec.pattern.Pattern`
  10. - :class:`pathspec.pattern.RegexPattern`
  11. - :class:`pathspec.util.RecursionError`
  12. The following functions are also imported:
  13. - :func:`pathspec.util.lookup_pattern`
  14. The following deprecated functions are also imported to maintain
  15. backward compatibility:
  16. - :func:`pathspec.util.iter_tree` which is an alias for
  17. :func:`pathspec.util.iter_tree_files`.
  18. - :func:`pathspec.util.match_files`
  19. """
  20. from .gitignore import (
  21. GitIgnoreSpec)
  22. from .pathspec import (
  23. PathSpec)
  24. from .pattern import (
  25. Pattern,
  26. RegexPattern)
  27. from .util import (
  28. RecursionError,
  29. iter_tree,
  30. lookup_pattern,
  31. match_files)
  32. from ._meta import (
  33. __author__,
  34. __copyright__,
  35. __credits__,
  36. __license__,
  37. __version__,
  38. )
  39. # Load pattern implementations.
  40. from . import patterns
  41. # DEPRECATED: Expose the `GitIgnorePattern` class in the root module for
  42. # backward compatibility with v0.4.
  43. from .patterns.gitwildmatch import GitIgnorePattern
  44. # Declare private imports as part of the public interface. Deprecated
  45. # imports are deliberately excluded.
  46. __all__ = [
  47. 'GitIgnoreSpec',
  48. 'PathSpec',
  49. 'Pattern',
  50. 'RecursionError',
  51. 'RegexPattern',
  52. '__author__',
  53. '__copyright__',
  54. '__credits__',
  55. '__license__',
  56. '__version__',
  57. 'iter_tree',
  58. 'lookup_pattern',
  59. 'match_files',
  60. ]