Adding type hints

This commit is contained in:
Adsooi 2024-09-17 22:26:17 +02:00
parent 52fd95551c
commit 1bf175b09c
Signed by: Ad5001
GPG key ID: EF45F9C6AFE20160
2 changed files with 4 additions and 4 deletions

View file

@ -66,11 +66,11 @@ class Latex(QObject):
self.tempdir = tempdir
@Property(bool)
def latexSupported(self):
def latexSupported(self) -> bool:
return LATEX_PATH is not None and DVIPNG_PATH is not None
@Slot(result=bool)
def checkLatexInstallation(self):
def checkLatexInstallation(self) -> bool:
"""
Checks if the current latex installation is valid.
"""
@ -121,7 +121,7 @@ class Latex(QObject):
return f'{export_path}.png,{img.width()},{img.height()}'
@Slot(str, float, QColor, result=str)
def findPrerendered(self, latex_markup: str, font_size: float, color: QColor):
def findPrerendered(self, latex_markup: str, font_size: float, color: QColor) -> str:
"""
Finds a prerendered image and returns its data if possible, and an empty string if not.
"""

View file

@ -54,7 +54,7 @@ class UpdateCheckerRunnable(QRunnable):
is_version_newer = version_tuple > current_version_tuple
if is_version_newer:
msg_text = QCoreApplication.translate("update",
"An update for LogarithPlotter (v{}) is available.").format(
"An update for LogarithmPlotter (v{}) is available.").format(
version)
update_available = True
else: