mypy linting

This commit is contained in:
Keith Edmunds 2024-07-03 18:03:41 +01:00
parent 553376a99e
commit f2867deb2f
4 changed files with 8 additions and 6 deletions

View File

@ -386,12 +386,12 @@ class TrackSelectDialog(QDialog):
event.accept() event.accept()
def keyPressEvent(self, event: QKeyEvent) -> None: def keyPressEvent(self, event: QKeyEvent | None) -> None:
""" """
Clear selection on ESC if there is one Clear selection on ESC if there is one
""" """
if event.key() == Qt.Key.Key_Escape: if event and event.key() == Qt.Key.Key_Escape:
if self.ui.matchList.selectedItems(): if self.ui.matchList.selectedItems():
self.ui.matchList.clearSelection() self.ui.matchList.clearSelection()
return return

View File

@ -305,6 +305,7 @@ def normalise_track(path: str) -> None:
os.chown(path, stats.st_uid, stats.st_gid) os.chown(path, stats.st_uid, stats.st_gid)
os.chmod(path, stats.st_mode) os.chmod(path, stats.st_mode)
# Copy tags # Copy tags
tag_handler: type[FLAC | MP3]
if ftype == "flac": if ftype == "flac":
tag_handler = FLAC tag_handler = FLAC
elif ftype == "mp3": elif ftype == "mp3":

View File

@ -1816,8 +1816,8 @@ if __name__ == "__main__":
msg = stackprinter.format(exc) msg = stackprinter.format(exc)
send_mail( send_mail(
Config.ERRORS_TO, ",".join(Config.ERRORS_TO),
Config.ERRORS_FROM, ",".join(Config.ERRORS_FROM),
"Exception from musicmuster", "Exception from musicmuster",
msg, msg,
) )

View File

@ -103,8 +103,9 @@ class _FadeCurve:
self.GraphWidget.clear() self.GraphWidget.clear()
def plot(self) -> None: def plot(self) -> None:
self.curve = self.GraphWidget.plot(self.graph_array) if self.GraphWidget:
self.curve.setPen(Config.FADE_CURVE_FOREGROUND) self.curve = self.GraphWidget.plot(self.graph_array)
self.curve.setPen(Config.FADE_CURVE_FOREGROUND)
def tick(self, play_time) -> None: def tick(self, play_time) -> None:
"""Update volume fade curve""" """Update volume fade curve"""