From fa43ba76a34e1bce01fa7f2d562a215423e6fcca Mon Sep 17 00:00:00 2001 From: DGrothe-PhD Date: Mon, 7 Oct 2024 20:37:55 +0200 Subject: [PATCH] linting --- speakerSetup.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/speakerSetup.py b/speakerSetup.py index 4ac239f..205c4fa 100644 --- a/speakerSetup.py +++ b/speakerSetup.py @@ -100,6 +100,7 @@ def talk(cls, text): @classmethod def talkInLanguage(cls, text, lang="system_default", rate = 200): + """Switches to a different language and speaks text""" if not cls.engine: if cls.speak: cls.speak(text) @@ -138,13 +139,13 @@ def prepareLanguages(cls): for voice in voices: if foundvoices == 3: break - if not "German" in cls.voices_dict and voice.name.__contains__("German"): + if "German" not in cls.voices_dict and "German" in voice.name: cls.voices_dict["German"] = voice.id foundvoices += 1 - if not "French" in cls.voices_dict and voice.name.__contains__("French"): + if "French" not in cls.voices_dict and "French" in voice.name: cls.voices_dict["French"] = voice.id foundvoices += 1 - elif not "English" in cls.voices_dict and voice.name.__contains__("English"): + elif "English" not in cls.voices_dict and "English" in voice.name: cls.voices_dict["English"] = voice.id foundvoices += 1 return voices