pyreverse.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  2. # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
  3. from typing import List, Optional, Tuple
  4. # This class could and should be replaced with a simple dataclass when support for Python < 3.7 is dropped.
  5. # A NamedTuple is not possible as some tests need to modify attributes during the test.
  6. class PyreverseConfig: # pylint: disable=too-many-instance-attributes, too-many-arguments
  7. """Holds the configuration options for Pyreverse.
  8. The default values correspond to the defaults of the options parser."""
  9. def __init__(
  10. self,
  11. mode: str = "PUB_ONLY",
  12. classes: Optional[List[str]] = None,
  13. show_ancestors: Optional[int] = None,
  14. all_ancestors: Optional[bool] = None,
  15. show_associated: Optional[int] = None,
  16. all_associated: Optional[bool] = None,
  17. show_builtin: bool = False,
  18. module_names: Optional[bool] = None,
  19. only_classnames: bool = False,
  20. output_format: str = "dot",
  21. colorized: bool = False,
  22. max_color_depth: int = 2,
  23. ignore_list: Tuple[str, ...] = tuple(),
  24. project: str = "",
  25. output_directory: str = "",
  26. ) -> None:
  27. self.mode = mode
  28. if classes:
  29. self.classes = classes
  30. else:
  31. self.classes = []
  32. self.show_ancestors = show_ancestors
  33. self.all_ancestors = all_ancestors
  34. self.show_associated = show_associated
  35. self.all_associated = all_associated
  36. self.show_builtin = show_builtin
  37. self.module_names = module_names
  38. self.only_classnames = only_classnames
  39. self.output_format = output_format
  40. self.colorized = colorized
  41. self.max_color_depth = max_color_depth
  42. self.ignore_list = ignore_list
  43. self.project = project
  44. self.output_directory = output_directory