My collection of plugins for the Qtile window manager.
git clone https://mcol.xyz/code/qtools
Log | Files | Refs | README

commit 91bde6e792150e42f9a3efae107ec8b6d6ebe858
parent 24dc6f308087392fe8b5ca315e3fa2afb4318755
Author: mcol <mcol@posteo.net>
Date:   Sat, 11 Jan 2020 22:03:08 +0000

clean up following flake8

Diffstat:
Mqtools/amixer/amixer.py | 7++++---
Mqtools/backlight/backlight.py | 5++++-
Mqtools/mpc/mpc.py | 2++
Mqtools/xresources/xresources.py | 6+++---
4 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/qtools/amixer/amixer.py b/qtools/amixer/amixer.py @@ -26,21 +26,22 @@ class Volume(Notifier): ('mixer', 'Master', 'ALSA mixer to control.'), ('interval', 5, 'Percentage interval to change volume by.'), ] + def __init__(self, **config): Notifier.__init__(self, **config) self.add_defaults(Volume.defaults) def increase(self, qtile=None): volume = self._run(f'{self.interval}%+') - self.show(self.interval * round(volume/self.interval)) + self.show(self.interval * round(volume / self.interval)) def decrease(self, qtile=None): volume = self._run(f'{self.interval}%-') - self.show(self.interval * round(volume/self.interval)) + self.show(self.interval * round(volume / self.interval)) def toggle(self, qtile=None): volume = self._run('toggle') - self.show(self.interval * round(volume/self.interval)) + self.show(self.interval * round(volume / self.interval)) def mute(self, qtile=None): self._run('mute') diff --git a/qtools/backlight/backlight.py b/qtools/backlight/backlight.py @@ -19,7 +19,10 @@ from qtools import Notifier class Backlight(Notifier): - + """ + This class controls screen backlight by directly reading and writing to the + backlight device file in /sys. + """ defaults = [ ('summary', 'Backlight', 'Notification summary.'), ('interval', 10, 'Percentage interval by which to change backlight'), diff --git a/qtools/mpc/mpc.py b/qtools/mpc/mpc.py @@ -13,6 +13,7 @@ Example usage: }.items()]) """ +# pylint: disable=no-member from functools import wraps @@ -55,6 +56,7 @@ class Client(Notifier): ('host', '127.0.0.1', 'IP address of MPD server.'), ('port', '6600', 'Port of MPD server.'), ] + def __init__(self, **config): Notifier.__init__(self, **config) self.add_defaults(Client.defaults) diff --git a/qtools/xresources/xresources.py b/qtools/xresources/xresources.py @@ -7,7 +7,7 @@ import xcffib import xcffib.xproto -def get(DISPLAY, defaults={}): +def get(DISPLAY, defaults=None): """ Get the X resources in an X servers resource manager. @@ -15,7 +15,7 @@ def get(DISPLAY, defaults={}): ========== DISPLAY : str DISPLAY name to query. - + defaults : dict (optional) Default values to act as a fallback for missing values or in the event of a failed connection. @@ -31,7 +31,7 @@ def get(DISPLAY, defaults={}): try: conn = xcffib.connect(display=DISPLAY) except xcffib.ConnectionException: - return defaults + return defaults if defaults else {} root = conn.get_setup().roots[0].root atom = conn.core.InternAtom(False, 16, 'RESOURCE_MANAGER').reply().atom