diff --git a/bumblebee_status/modules/contrib/shell.py b/bumblebee_status/modules/contrib/shell.py index 6e52412..5ce41d1 100644 --- a/bumblebee_status/modules/contrib/shell.py +++ b/bumblebee_status/modules/contrib/shell.py @@ -35,8 +35,6 @@ import os import subprocess import threading import functools -import logging -import sys import core.module import core.widget @@ -53,11 +51,11 @@ class Module(core.module.Module): self.__command = self.parameter("command", 'echo "no command configured"') self.__left_click_command = self.parameter( - "left_click_command", - 'echo "no left_click_command configured"') + "left_click_command", 'echo "no left_click_command configured"' + ) self.__right_click_command = self.parameter( - "right_click_command", - 'echo "no right_click_command configured"') + "right_click_command", 'echo "no right_click_command configured"' + ) self.__async = util.format.asbool(self.parameter("async")) if self.__async: @@ -72,15 +70,17 @@ class Module(core.module.Module): self.widget, button=core.input.LEFT_MOUSE, cmd=functools.partial( - self.click_command, - command=self.__left_click_command)) + self.click_command, command=self.__left_click_command + ), + ) if self.__right_click_command is not None: core.input.register( self.widget, button=core.input.RIGHT_MOUSE, cmd=functools.partial( - self.click_command, - command=self.__right_click_command)) + self.click_command, command=self.__right_click_command + ), + ) def set_output(self, value): self.__output = value diff --git a/bumblebee_status/util/cli.py b/bumblebee_status/util/cli.py index 2b101fa..903f948 100644 --- a/bumblebee_status/util/cli.py +++ b/bumblebee_status/util/cli.py @@ -56,12 +56,14 @@ def execute( try: out, _ = proc.communicate(timeout=timeout) except subprocess.TimeoutExpired as e: - logging.warning(f''' + logging.warning( + f""" Communication with process pid={proc.pid} hangs for more than {timeout} seconds. If this is not expected, the process is stale, or you might have run in stdout / stderr deadlock. - ''') + """ + ) out, _ = proc.communicate() if proc.returncode != 0: err = "{} exited with code {}".format(cmd, proc.returncode)