Narrow scope of various pylint inline disables (#15364)

* Narrow scope of various pylint inline disables

* Whitespace tweaks
This commit is contained in:
Ville Skyttä 2018-10-10 13:17:11 +03:00 committed by Paulus Schoutsen
parent 78c38749ab
commit 707b7c202d
30 changed files with 52 additions and 75 deletions

View file

@ -4,7 +4,6 @@ Receive signals from a keyboard and use it as a remote control.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/keyboard_remote/
"""
# pylint: disable=import-error
import threading
import logging
import os
@ -90,6 +89,7 @@ class KeyboardRemoteThread(threading.Thread):
id_folder = '/dev/input/by-id/'
if os.path.isdir(id_folder):
# pylint: disable=import-error
from evdev import InputDevice, list_devices
device_names = [InputDevice(file_name).name
for file_name in list_devices()]
@ -104,6 +104,7 @@ class KeyboardRemoteThread(threading.Thread):
def _get_keyboard_device(self):
"""Get the keyboard device."""
# pylint: disable=import-error
from evdev import InputDevice, list_devices
if self.device_name:
devices = [InputDevice(file_name) for file_name in list_devices()]
@ -121,6 +122,7 @@ class KeyboardRemoteThread(threading.Thread):
def run(self):
"""Run the loop of the KeyboardRemote."""
# pylint: disable=import-error
from evdev import categorize, ecodes
if self.dev is not None: