This repository has been archived on 2026-10-10. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
shutter-view-api/lib/python3.9/site-packages/pylint/pyreverse/printer_factory.py
T
2022-12-10 21:17:54 -06:00

25 lines
900 B
Python

# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt
from __future__ import annotations
from pylint.pyreverse.dot_printer import DotPrinter
from pylint.pyreverse.mermaidjs_printer import HTMLMermaidJSPrinter, MermaidJSPrinter
from pylint.pyreverse.plantuml_printer import PlantUmlPrinter
from pylint.pyreverse.printer import Printer
from pylint.pyreverse.vcg_printer import VCGPrinter
filetype_to_printer: dict[str, type[Printer]] = {
"vcg": VCGPrinter,
"plantuml": PlantUmlPrinter,
"puml": PlantUmlPrinter,
"mmd": MermaidJSPrinter,
"html": HTMLMermaidJSPrinter,
"dot": DotPrinter,
}
def get_printer_for_filetype(filetype: str) -> type[Printer]:
return filetype_to_printer.get(filetype, DotPrinter)