[modules/dunst] Single quotes

This commit is contained in:
Tobias Witek 2020-03-07 13:49:09 +01:00
parent b373de4cad
commit 4bc5f73ccc

View file

@ -1,6 +1,6 @@
#pylint: disable=C0111,R0903 #pylint: disable=C0111,R0903
"""Toggle dunst notifications.""" '''Toggle dunst notifications.'''
import bumblebee.input import bumblebee.input
import bumblebee.output import bumblebee.output
@ -10,12 +10,12 @@ import bumblebee.engine
class Module(bumblebee.engine.Module): class Module(bumblebee.engine.Module):
def __init__(self, engine, config): def __init__(self, engine, config):
super(Module, self).__init__(engine, config, super(Module, self).__init__(engine, config,
bumblebee.output.Widget(full_text="") bumblebee.output.Widget(full_text='')
) )
self._paused = False self._paused = False
# Make sure that dunst is currently not paused # Make sure that dunst is currently not paused
try: try:
bumblebee.util.execute("killall -SIGUSR2 dunst") bumblebee.util.execute('killall -SIGUSR2 dunst')
except: except:
pass pass
engine.input.register_callback(self, button=bumblebee.input.LEFT_MOUSE, engine.input.register_callback(self, button=bumblebee.input.LEFT_MOUSE,
@ -27,13 +27,13 @@ class Module(bumblebee.engine.Module):
try: try:
if self._paused: if self._paused:
bumblebee.util.execute("killall -SIGUSR1 dunst") bumblebee.util.execute('killall -SIGUSR1 dunst')
else: else:
bumblebee.util.execute("killall -SIGUSR2 dunst") bumblebee.util.execute('killall -SIGUSR2 dunst')
except: except:
self._paused = not self._paused # toggling failed self._paused = not self._paused # toggling failed
def state(self, widget): def state(self, widget):
if self._paused: if self._paused:
return ["muted", "warning"] return ['muted', 'warning']
return ["unmuted"] return ['unmuted']