Skip to content

Commit

Permalink
♻️ Fix minor code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreMiras committed Sep 26, 2024
1 parent 76142b5 commit 10e7935
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions pycaw/magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def _match_sess_to_mapp(cls, magic_root_session, iid):
for magic_app in cls.magic_apps:
for app_exec in magic_app.app_execs:
if app_exec == new_app_exec:
log.info(f"Match {magic_root_session} " f"{magic_app}")
log.info(f"Match {magic_root_session} {magic_app}")
magic_app.add_magic_root_session(iid, magic_root_session)
# return will prohibit multiple magic_apps
# to use the same magic_root_session
Expand Down Expand Up @@ -362,8 +362,6 @@ def unregister_all(cls):
cls.magic_activated = None


# TODO:
# Make it more pythonic and beautifull
def for_session_in_sessions(func):
"""Decorator for looping through sessions in MagicApp."""

Expand Down Expand Up @@ -393,8 +391,8 @@ class _MagicAudioControl:
"""Simplifies the audio control by using the self.properties."""

# TODO:
# (this TODO applies to MagicApp, MagicSession, for_session_in_sessions)
# handle incorrect input or raise exception.
# MagicApp, MagicSession and for_session_in_sessions to handle incorrect
# input or raise exception.
# also handle failing com calls
# (failing in terms of the retrieved value is not 'S_OK')
# it will happen, when the speaker is gets disconnected!
Expand Down Expand Up @@ -436,7 +434,7 @@ def __init__(
session_callback=None,
):
# normalize app_execs
if type(app_execs) == str:
if isinstance(app_execs, str):
# if string directly to set: {'a', 'b', 'c'}
app_execs = (app_execs,)
self.app_execs = set(app_execs)
Expand Down

0 comments on commit 10e7935

Please # to comment.