(important: bool = False)
A context that should be used around every mopidy command used.
    Makes sure that commands occur sequentially, as mopidy can not handle parallel inputs.
    Use it like this:
    with mopidy_command() as allowed:
        if allowed:
            # mopidy command
    :param important: If True, wait until the lock is released.
    If not, return 'False' after a timeout.
A context that should be used around every mopidy command used.
    Makes sure that commands occur sequentially, as mopidy can not handle parallel inputs.
    Use it like this:
    with mopidy_command() as allowed:
        if allowed:
            # mopidy command
    :param important: If True, wait until the lock is released.
    If not, return 'False' after a timeout.
A context that should be used around every mopidy command used . Makes sure that commands occur sequentially as mopidy can not handle parallel inputs . Use it like this : with mopidy_command () as allowed : if allowed : # mopidy command : param important : If True wait until the lock is released . If not return False after a timeout .
def mopidy_command(important: bool = False) -> Iterator[bool]:
    """A context that should be used around every mopidy command used.
    Makes sure that commands occur sequentially, as mopidy can not handle parallel inputs.
    Use it like this:
    with mopidy_command() as allowed:
        if allowed:
            # mopidy command
    :param important: If True, wait until the lock is released.
    If not, return 'False' after a timeout."""
    timeout = 3
    if important:
        timeout = None
    if player_lock.acquire(blocking_timeout=timeout):
        yield True
        player_lock.release()
    else:
        logging.warning("mopidy command could not be executed")
        set_playback_error(True)
        yield False
def mopidy_command ( important : bool = False ) -> Iterator [ bool ] : timeout = 3 if important : timeout = None if player_lock . acquire ( blocking_timeout = timeout ) : yield True player_lock . release ( ) else : logging . warning ( "mopidy command could not be executed" ) set_playback_error ( True ) yield False