reporters.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. class BaseReporter(object):
  2. """Delegate class to provider progress reporting for the resolver."""
  3. def starting(self):
  4. """Called before the resolution actually starts."""
  5. def starting_round(self, index):
  6. """Called before each round of resolution starts.
  7. The index is zero-based.
  8. """
  9. def ending_round(self, index, state):
  10. """Called before each round of resolution ends.
  11. This is NOT called if the resolution ends at this round. Use `ending`
  12. if you want to report finalization. The index is zero-based.
  13. """
  14. def ending(self, state):
  15. """Called before the resolution ends successfully."""
  16. def adding_requirement(self, requirement, parent):
  17. """Called when adding a new requirement into the resolve criteria.
  18. :param requirement: The additional requirement to be applied to filter
  19. the available candidaites.
  20. :param parent: The candidate that requires ``requirement`` as a
  21. dependency, or None if ``requirement`` is one of the root
  22. requirements passed in from ``Resolver.resolve()``.
  23. """
  24. def backtracking(self, candidate):
  25. """Called when rejecting a candidate during backtracking."""
  26. def pinning(self, candidate):
  27. """Called when adding a candidate to the potential solution."""