From 4fa7bc196a66134238fe3eeb91ede8366c6783ab Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Fri, 1 Jun 2018 22:49:04 +0200 Subject: [PATCH] Warn about tornado. Fixes #24 --- .travis.yml | 2 +- esphomeyaml/dashboard/dashboard.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2d7f917660..2b5f0970a2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ python: - "2.7" install: - pip install -r requirements.txt - - pip install flake8==3.5.0 pylint==1.8.4 + - pip install tornado esptool flake8==3.5.0 pylint==1.8.4 script: - flake8 esphomeyaml - pylint esphomeyaml diff --git a/esphomeyaml/dashboard/dashboard.py b/esphomeyaml/dashboard/dashboard.py index ac22c1545e..599dc0832e 100644 --- a/esphomeyaml/dashboard/dashboard.py +++ b/esphomeyaml/dashboard/dashboard.py @@ -7,6 +7,8 @@ import os import random import subprocess +_LOGGER = logging.getLogger(__name__) + try: import tornado import tornado.gen @@ -17,15 +19,16 @@ try: import tornado.websocket import tornado.concurrent except ImportError as err: - pass + _LOGGER.error("Attempted to load dashboard, but tornado is not installed! " + "Please run \"pip2 install tornado esptool\" in your terminal.") from esphomeyaml import const, core, __main__ from esphomeyaml.__main__ import get_serial_ports, get_base_path, get_name 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):