From 246794c40e7774dfa974f2f8275456401ed03b53 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Mon, 21 May 2018 16:31:30 +0200 Subject: [PATCH] Fix pylint errors --- esphomeyaml/__main__.py | 9 +++++---- esphomeyaml/hassio/hassio.py | 11 +---------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/esphomeyaml/__main__.py b/esphomeyaml/__main__.py index a7cb0f9e5b..2bd1b9759a 100644 --- a/esphomeyaml/__main__.py +++ b/esphomeyaml/__main__.py @@ -76,13 +76,13 @@ def run_platformio(*cmd, **kwargs): full_cmd = u' '.join(quote(x) for x in cmd) _LOGGER.info(u"Running: %s", full_cmd) try: - main = kwargs.get('main') - if main is None: + func = kwargs.get('main') + if func is None: import platformio.__main__ - main = platformio.__main__.main + func = platformio.__main__.main sys.argv = list(cmd) sys.exit = mock_exit - return main() or 0 + return func() or 0 except KeyboardInterrupt: return 1 except SystemExit as err: @@ -177,6 +177,7 @@ def upload_using_esptool(config, port): name = get_name(config) path = os.path.join(get_base_path(config), '.pioenvs', name, 'firmware.bin') + # pylint: disable=protected-access return run_platformio('esptool.py', '--before', 'default_reset', '--after', 'hard_reset', '--chip', 'esp8266', '--port', port, 'write_flash', '0x0', path, main=esptool._main) diff --git a/esphomeyaml/hassio/hassio.py b/esphomeyaml/hassio/hassio.py index 114a916471..4b43358cc1 100644 --- a/esphomeyaml/hassio/hassio.py +++ b/esphomeyaml/hassio/hassio.py @@ -26,7 +26,7 @@ from esphomeyaml.helpers import quote _LOGGER = logging.getLogger(__name__) CONFIG_DIR = '' - +# pylint: disable=abstract-method, arguments-differ class EsphomeyamlCommandWebSocket(tornado.websocket.WebSocketHandler): def __init__(self, application, request, **kwargs): super(EsphomeyamlCommandWebSocket, self).__init__(application, request, **kwargs) @@ -72,9 +72,6 @@ class EsphomeyamlCommandWebSocket(tornado.websocket.WebSocketHandler): class EsphomeyamlLogsHandler(EsphomeyamlCommandWebSocket): - def __init__(self, application, request, **kwargs): - super(EsphomeyamlLogsHandler, self).__init__(application, request, **kwargs) - def build_command(self, message): js = json.loads(message) config_file = CONFIG_DIR + '/' + js['configuration'] @@ -82,9 +79,6 @@ class EsphomeyamlLogsHandler(EsphomeyamlCommandWebSocket): class EsphomeyamlRunHandler(EsphomeyamlCommandWebSocket): - def __init__(self, application, request, **kwargs): - super(EsphomeyamlRunHandler, self).__init__(application, request, **kwargs) - def build_command(self, message): js = json.loads(message) config_file = os.path.join(CONFIG_DIR, js['configuration']) @@ -93,9 +87,6 @@ class EsphomeyamlRunHandler(EsphomeyamlCommandWebSocket): class EsphomeyamlCompileHandler(EsphomeyamlCommandWebSocket): - def __init__(self, application, request, **kwargs): - super(EsphomeyamlCompileHandler, self).__init__(application, request, **kwargs) - def build_command(self, message): js = json.loads(message) config_file = os.path.join(CONFIG_DIR, js['configuration'])