forked from platformio/platformio-core
Speedup PIO Home via internal calling of PIO Core CLI
This commit is contained in:
1 parent
500b3e08fe
commit
dfca7f0b68
8 files changed
+41
-31
No files matched your search
@@ -20,6 +20,7 @@ import socket
|
||||
import stat
|
||||
import sys
|
||||
import time
|
||||
from contextlib import contextmanager
|
||||
from functools import wraps
|
||||
from glob import glob
|
||||
from os.path import abspath, basename, dirname, isfile, join
|
||||
@@ -107,6 +108,17 @@ def singleton(cls):
|
||||
return get_instance
|
||||
|
||||
|
||||
@contextmanager
|
||||
def capture_std_streams(stdout, stderr=None):
|
||||
_stdout = sys.stdout
|
||||
_stderr = sys.stderr
|
||||
sys.stdout = stdout
|
||||
sys.stderr = stderr or stdout
|
||||
yield
|
||||
sys.stdout = _stdout
|
||||
sys.stderr = _stderr
|
||||
|
||||
|
||||
def load_json(file_path):
|
||||
try:
|
||||
with open(file_path, "r") as f:
|
||||
|
||||
Reference in new issue
Block a user