Warn about tornado. Fixes #24

This commit is contained in:
Otto Winter 2018-06-01 22:49:04 +02:00
parent 65d0dd47f3
commit 4fa7bc196a
No known key found for this signature in database
GPG Key ID: DB66C0BE6013F97E
2 changed files with 6 additions and 3 deletions

View File

@ -4,7 +4,7 @@ python:
- "2.7" - "2.7"
install: install:
- pip install -r requirements.txt - 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: script:
- flake8 esphomeyaml - flake8 esphomeyaml
- pylint esphomeyaml - pylint esphomeyaml

View File

@ -7,6 +7,8 @@ import os
import random import random
import subprocess import subprocess
_LOGGER = logging.getLogger(__name__)
try: try:
import tornado import tornado
import tornado.gen import tornado.gen
@ -17,15 +19,16 @@ try:
import tornado.websocket import tornado.websocket
import tornado.concurrent import tornado.concurrent
except ImportError as err: 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 import const, core, __main__
from esphomeyaml.__main__ import get_serial_ports, get_base_path, get_name from esphomeyaml.__main__ import get_serial_ports, get_base_path, get_name
from esphomeyaml.helpers import quote from esphomeyaml.helpers import quote
_LOGGER = logging.getLogger(__name__)
CONFIG_DIR = '' CONFIG_DIR = ''
# pylint: disable=abstract-method, arguments-differ # 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):