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

Platformio debug

This commit is contained in:
Otto Winter 2018-12-04 20:06:43 +01:00
parent f9c62a660e
commit a28c879e66
No known key found for this signature in database
GPG Key ID: DB66C0BE6013F97E

View File

@ -1,3 +1,5 @@
from __future__ import print_function
import json
import logging
import re
@ -10,9 +12,28 @@ _LOGGER = logging.getLogger(__name__)
def run_platformio_cli(*args, **kwargs):
cmd = ['platformio'] + list(args)
try:
import click
# pylint: disable=protected-access
print("ON Windows: {}".format(click._compat.WIN))
def strip_ansi(x):
print("strip_ansi({})".format(x))
click._compat.strip_ansi = lambda x: x
def should_strip_ansi(stream=None, color=None):
print("should_strip_ansi({}, {})".format(stream, color))
return False
click._compat.should_strip_ansi = lambda x: False
except Exception as e: # pylint: disable=broad-except
print("Error: {}".format(e))
import platformio.__main__
cmd = ['platformio'] + list(args)
return run_external_command(platformio.__main__.main,
*cmd, **kwargs)