1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-15 15:18:16 +00:00

Fix pylint errors

This commit is contained in:
Otto Winter 2018-05-21 16:31:30 +02:00
parent b8c55c5043
commit 246794c40e
No known key found for this signature in database
GPG Key ID: DB66C0BE6013F97E
2 changed files with 6 additions and 14 deletions

View File

@ -76,13 +76,13 @@ def run_platformio(*cmd, **kwargs):
full_cmd = u' '.join(quote(x) for x in cmd) full_cmd = u' '.join(quote(x) for x in cmd)
_LOGGER.info(u"Running: %s", full_cmd) _LOGGER.info(u"Running: %s", full_cmd)
try: try:
main = kwargs.get('main') func = kwargs.get('main')
if main is None: if func is None:
import platformio.__main__ import platformio.__main__
main = platformio.__main__.main func = platformio.__main__.main
sys.argv = list(cmd) sys.argv = list(cmd)
sys.exit = mock_exit sys.exit = mock_exit
return main() or 0 return func() or 0
except KeyboardInterrupt: except KeyboardInterrupt:
return 1 return 1
except SystemExit as err: except SystemExit as err:
@ -177,6 +177,7 @@ def upload_using_esptool(config, port):
name = get_name(config) name = get_name(config)
path = os.path.join(get_base_path(config), '.pioenvs', name, 'firmware.bin') 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', return run_platformio('esptool.py', '--before', 'default_reset', '--after', 'hard_reset',
'--chip', 'esp8266', '--port', port, 'write_flash', '0x0', '--chip', 'esp8266', '--port', port, 'write_flash', '0x0',
path, main=esptool._main) path, main=esptool._main)

View File

@ -26,7 +26,7 @@ from esphomeyaml.helpers import quote
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
CONFIG_DIR = '' CONFIG_DIR = ''
# pylint: disable=abstract-method, arguments-differ
class EsphomeyamlCommandWebSocket(tornado.websocket.WebSocketHandler): class EsphomeyamlCommandWebSocket(tornado.websocket.WebSocketHandler):
def __init__(self, application, request, **kwargs): def __init__(self, application, request, **kwargs):
super(EsphomeyamlCommandWebSocket, self).__init__(application, request, **kwargs) super(EsphomeyamlCommandWebSocket, self).__init__(application, request, **kwargs)
@ -72,9 +72,6 @@ class EsphomeyamlCommandWebSocket(tornado.websocket.WebSocketHandler):
class EsphomeyamlLogsHandler(EsphomeyamlCommandWebSocket): class EsphomeyamlLogsHandler(EsphomeyamlCommandWebSocket):
def __init__(self, application, request, **kwargs):
super(EsphomeyamlLogsHandler, self).__init__(application, request, **kwargs)
def build_command(self, message): def build_command(self, message):
js = json.loads(message) js = json.loads(message)
config_file = CONFIG_DIR + '/' + js['configuration'] config_file = CONFIG_DIR + '/' + js['configuration']
@ -82,9 +79,6 @@ class EsphomeyamlLogsHandler(EsphomeyamlCommandWebSocket):
class EsphomeyamlRunHandler(EsphomeyamlCommandWebSocket): class EsphomeyamlRunHandler(EsphomeyamlCommandWebSocket):
def __init__(self, application, request, **kwargs):
super(EsphomeyamlRunHandler, self).__init__(application, request, **kwargs)
def build_command(self, message): def build_command(self, message):
js = json.loads(message) js = json.loads(message)
config_file = os.path.join(CONFIG_DIR, js['configuration']) config_file = os.path.join(CONFIG_DIR, js['configuration'])
@ -93,9 +87,6 @@ class EsphomeyamlRunHandler(EsphomeyamlCommandWebSocket):
class EsphomeyamlCompileHandler(EsphomeyamlCommandWebSocket): class EsphomeyamlCompileHandler(EsphomeyamlCommandWebSocket):
def __init__(self, application, request, **kwargs):
super(EsphomeyamlCompileHandler, self).__init__(application, request, **kwargs)
def build_command(self, message): def build_command(self, message):
js = json.loads(message) js = json.loads(message)
config_file = os.path.join(CONFIG_DIR, js['configuration']) config_file = os.path.join(CONFIG_DIR, js['configuration'])