diff --git a/.flake8 b/.flake8 index 0f8d718e2..775e0339d 100644 --- a/.flake8 +++ b/.flake8 @@ -14,7 +14,8 @@ per-file-ignores = # Not necessary, if __all__ is declared in __init__ file # https://www.python.org/dev/peps/pep-0008/#id48 __init__.py:F401, - components/smart-home-automation/MQTT-protocol/daemon_mqtt_client.py:W605 + components/smart-home-automation/MQTT-protocol/daemon_mqtt_client.py:W605, + components/controls/buttons_usb_encoder/*.py:E402 count = True max-complexity = 12 statistics = True diff --git a/components/controls/buttons_usb_encoder/buttons_usb_encoder.py b/components/controls/buttons_usb_encoder/buttons_usb_encoder.py index b97cccc54..777278467 100644 --- a/components/controls/buttons_usb_encoder/buttons_usb_encoder.py +++ b/components/controls/buttons_usb_encoder/buttons_usb_encoder.py @@ -4,10 +4,10 @@ sys.path.append(".") # This command should be before imports of components -import logging # noqa E402 -from evdev import categorize, ecodes, KeyEvent # noqa E402 -from io_buttons_usb_encoder import button_map, current_device # noqa E402 -from components.gpio_control.function_calls import phoniebox_function_calls # noqa E402 +import logging +from evdev import categorize, ecodes, KeyEvent +from io_buttons_usb_encoder import button_map, current_device +from components.gpio_control.function_calls import phoniebox_function_calls sys.path.append(".") diff --git a/components/controls/buttons_usb_encoder/io_buttons_usb_encoder.py b/components/controls/buttons_usb_encoder/io_buttons_usb_encoder.py index c20e5c366..2f03f8191 100644 --- a/components/controls/buttons_usb_encoder/io_buttons_usb_encoder.py +++ b/components/controls/buttons_usb_encoder/io_buttons_usb_encoder.py @@ -28,7 +28,7 @@ def current_device(): break try: _current_device - except: + except Exception: sys.exit('Could not find the device %s\n. Make sure it is connected' % device_name) return _current_device