mirror of
https://github.com/esphome/esphome.git
synced 2025-03-19 09:08:16 +00:00
Platformio debug
This commit is contained in:
parent
f9c62a660e
commit
a28c879e66
@ -1,3 +1,5 @@
|
|||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
@ -10,9 +12,28 @@ _LOGGER = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
def run_platformio_cli(*args, **kwargs):
|
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__
|
import platformio.__main__
|
||||||
|
|
||||||
cmd = ['platformio'] + list(args)
|
|
||||||
return run_external_command(platformio.__main__.main,
|
return run_external_command(platformio.__main__.main,
|
||||||
*cmd, **kwargs)
|
*cmd, **kwargs)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user