Format code

master
Lars Vierbergen 8 years ago
parent 3591ba114d
commit be2bcef6fa
  1. 1
      modules/toggle.py
  2. 4
      modules/volume.py

@ -15,6 +15,7 @@ class ToggleControl(AbstractControl, metaclass=abc.ABCMeta):
The toggle button will show a text in upper or lower case, depending on the activation state of the button. The toggle button will show a text in upper or lower case, depending on the activation state of the button.
A click on the button toggles the button by calling toggle() A click on the button toggles the button by calling toggle()
""" """
def __init__(self, letter: str, initial_state: bool = False): def __init__(self, letter: str, initial_state: bool = False):
""" """
:param letter: The text to show on the toggle control. Will be upper- or lowercased when the button is activated or deactivated. :param letter: The text to show on the toggle control. Will be upper- or lowercased when the button is activated or deactivated.

@ -140,6 +140,7 @@ class PaCtlVolumeControl(AbstractVolumeControl):
try: try:
import pulsectl import pulsectl
class PulseCtlVolumeControl(AbstractVolumeControl): class PulseCtlVolumeControl(AbstractVolumeControl):
def __init__(self): def __init__(self):
super().__init__() super().__init__()
@ -149,7 +150,8 @@ try:
def periodic(self): def periodic(self):
server_info = self.__pulse.server_info() server_info = self.__pulse.server_info()
self.__default_sink = next(filter(lambda sink: sink.name == server_info.default_sink_name, self.__pulse.sink_list())) self.__default_sink = next(
filter(lambda sink: sink.name == server_info.default_sink_name, self.__pulse.sink_list()))
prev_muted = self.muted prev_muted = self.muted
self.muted = bool(self.__default_sink.mute) self.muted = bool(self.__default_sink.mute)
prev_volume = self.volume prev_volume = self.volume

Loading…
Cancel
Save