Source code for qlauncher.exceptions

 1"""Module for different exceptions used by qlauncher."""
 2
 3
[docs] 4class DependencyError(ImportError): 5 """Error connected with missing optional dependencies and wrong installation.""" 6 7 def __init__(self, e: ImportError, install_hint: str = '', *, private: bool = False) -> None: 8 if private: 9 message = ( 10 f"""Module "{e.name}" is required but not installed. """ 11 """The module needs to be installed but it's private. """ 12 """To get access to module contact the library developers.""" 13 ) 14 else: 15 message = f"""Module "{e.name}" is required but not installed. Install it with: pip install "qlauncher[{install_hint}]".""" 16 super().__init__(message, name=e.name)