mirror of
https://github.com/espressif/esp-idf.git
synced 2025-11-15 15:00:02 +01:00
style: format python files with isort and double-quote-string-fixer
This commit is contained in:
@@ -2,11 +2,12 @@
|
||||
#
|
||||
# Wrapper to run make and preprocess any paths in the output from MSYS Unix-style paths
|
||||
# to Windows paths, for Eclipse
|
||||
from __future__ import print_function, division
|
||||
import sys
|
||||
import subprocess
|
||||
from __future__ import division, print_function
|
||||
|
||||
import os.path
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
UNIX_PATH_RE = re.compile(r'(/[^ \'"]+)+')
|
||||
|
||||
@@ -20,24 +21,24 @@ def check_path(path):
|
||||
pass
|
||||
paths[path] = path # cache as failed, replace with success if it works
|
||||
try:
|
||||
winpath = subprocess.check_output(["cygpath", "-w", path]).decode().strip()
|
||||
winpath = subprocess.check_output(['cygpath', '-w', path]).decode().strip()
|
||||
except subprocess.CalledProcessError:
|
||||
return path # something went wrong running cygpath, assume this is not a path!
|
||||
if not os.path.exists(winpath):
|
||||
return path # not actually a valid path
|
||||
winpath = winpath.replace("\\", "/") # make consistent with forward-slashes used elsewhere
|
||||
winpath = winpath.replace('\\', '/') # make consistent with forward-slashes used elsewhere
|
||||
paths[path] = winpath
|
||||
return winpath
|
||||
|
||||
|
||||
def main():
|
||||
print("Running make in '%s'" % check_path(os.getcwd()))
|
||||
make = subprocess.Popen(["make"] + sys.argv[1:] + ["BATCH_BUILD=1"], stdout=subprocess.PIPE)
|
||||
make = subprocess.Popen(['make'] + sys.argv[1:] + ['BATCH_BUILD=1'], stdout=subprocess.PIPE)
|
||||
for line in iter(make.stdout.readline, ''):
|
||||
line = re.sub(UNIX_PATH_RE, lambda m: check_path(m.group(0)), line)
|
||||
print(line.rstrip())
|
||||
sys.exit(make.wait())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user