From 51c856e65eed7800a00da1cb256b50c4bb9fc6ed Mon Sep 17 00:00:00 2001 From: Jimmy Hedman Date: Tue, 10 Apr 2018 16:21:32 +0200 Subject: [PATCH] It now complies with flake8 --ignore=E501,W291 (#1) - Not changning long lines or lines ending with space. --- esphomeyaml/__main__.py | 10 ++++------ esphomeyaml/config.py | 2 +- esphomeyaml/espota.py | 3 ++- esphomeyaml/helpers.py | 2 +- esphomeyaml/wizard.py | 1 - esphomeyaml/writer.py | 2 +- 6 files changed, 9 insertions(+), 11 deletions(-) diff --git a/esphomeyaml/__main__.py b/esphomeyaml/__main__.py index d5abeb3b53..a38b2ac3cc 100644 --- a/esphomeyaml/__main__.py +++ b/esphomeyaml/__main__.py @@ -205,11 +205,9 @@ def main(): parser.add_argument('configuration', help='Your YAML configuration file.') subparsers = parser.add_subparsers(help='Commands', dest='command') subparsers.required = True - parser_config = subparsers.add_parser('config', - help='Validate the configuration and spit it out.') + subparsers.add_parser('config', help='Validate the configuration and spit it out.') - parser_compile = subparsers.add_parser('compile', - help='Read the configuration and compile a program.') + subparsers.add_parser('compile', help='Read the configuration and compile a program.') parser_upload = subparsers.add_parser('upload', help='Validate the configuration ' 'and upload the latest binary.') @@ -245,8 +243,8 @@ def main(): parser_clean.add_argument('--password', help='Manually set the password.') parser_clean.add_argument('--client-id', help='Manually set the client id.') - parser_wizard = subparsers.add_parser('wizard', help="A helpful setup wizard that will guide " - "you through setting up esphomeyaml.") + subparsers.add_parser('wizard', help="A helpful setup wizard that will guide " + "you through setting up esphomeyaml.") args = parser.parse_args() diff --git a/esphomeyaml/config.py b/esphomeyaml/config.py index 6c5fe2ce15..409338d13d 100644 --- a/esphomeyaml/config.py +++ b/esphomeyaml/config.py @@ -197,7 +197,7 @@ def load_config(path): try: result = validate_config(config) - except Exception as e: + except Exception: print(u"Unexpected exception while reading configuration:") raise diff --git a/esphomeyaml/espota.py b/esphomeyaml/espota.py index 09a536759a..086c60e3f2 100755 --- a/esphomeyaml/espota.py +++ b/esphomeyaml/espota.py @@ -183,7 +183,8 @@ def serve(remote_host, local_addr, remote_port, local_port, password, filename, offset = 0 while True: chunk = f.read(1024) - if not chunk: break + if not chunk: + break offset += len(chunk) update_progress(offset / float(content_size)) connection.settimeout(10) diff --git a/esphomeyaml/helpers.py b/esphomeyaml/helpers.py index cc34d62469..2180c5a347 100644 --- a/esphomeyaml/helpers.py +++ b/esphomeyaml/helpers.py @@ -392,7 +392,7 @@ def quote(s): return u"'" + s.replace(u"'", u"'\"'\"'") + u"'" -def color(the_color, message = '', reset=None): +def color(the_color, message='', reset=None): """Color helper.""" from colorlog.escape_codes import escape_codes, parse_colors if not message: diff --git a/esphomeyaml/wizard.py b/esphomeyaml/wizard.py index 394457ac8e..08854655f3 100644 --- a/esphomeyaml/wizard.py +++ b/esphomeyaml/wizard.py @@ -290,4 +290,3 @@ def wizard(path): print(" > Then follow the rest of the getting started guide:") print(" > https://esphomelib.com/esphomeyaml/getting-started.html") return 0 - diff --git a/esphomeyaml/writer.py b/esphomeyaml/writer.py index 9171fa0268..26d81b7897 100644 --- a/esphomeyaml/writer.py +++ b/esphomeyaml/writer.py @@ -6,7 +6,7 @@ import os from esphomeyaml.config import get_component from esphomeyaml.const import CONF_BOARD, CONF_ESPHOMEYAML, CONF_LIBRARY_URI, CONF_LOGGER, \ - CONF_NAME, CONF_OTA, CONF_PLATFORM, ESP_PLATFORM_ESP32, ESP_PLATFORM_ESP8266 + CONF_NAME, CONF_PLATFORM, ESP_PLATFORM_ESP32, ESP_PLATFORM_ESP8266 from esphomeyaml.core import ESPHomeYAMLError CPP_AUTO_GENERATE_BEGIN = u'// ========== AUTO GENERATED CODE BEGIN ==========='