Skip to content

Commit eadbc29

Browse files
Add 'if not quiet' to the print statements
1 parent 853dc57 commit eadbc29

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

circuitpython_build_tools/build.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,24 +78,27 @@ def mpy_cross(mpy_cross_filename, circuitpython_tag, quiet=False):
7878
s3_url = f"{S3_MPY_PREFIX}mpy-cross.static-raspbian-{circuitpython_tag}"
7979
elif uname[0] == 'Darwin' and uname[4] == 'x86_64':
8080
s3_url = f"{S3_MPY_PREFIX}mpy-cross-macos-catalina-{circuitpython_tag}"
81-
else:
82-
print(f"\nUnable to check S3 for sysname='{uname[0]}' release='{uname[2]}' machine='{uname[4]}'.")
83-
print(" Please file an issue at https://github.com/adafruit/circuitpython-build-tools/ with the above message")
81+
elif not quiet:
82+
print(f"Pre-built mpy-cross not available for sysname='{uname[0]}' release='{uname[2]}' machine='{uname[4]}'.")
8483

8584
if s3_url is not None:
86-
print(f"Checking S3 for {s3_url}")
85+
if not quiet:
86+
print(f"Checking S3 for {s3_url}")
8787
try:
8888
r = requests.get(s3_url)
8989
if r.status_code == 200:
9090
with open(mpy_cross_filename, "wb") as f:
9191
f.write(r.content)
9292
# Set the User Execute bit
9393
os.chmod(mpy_cross_filename, os.stat(mpy_cross_filename)[0] | stat.S_IXUSR)
94-
print(" FOUND")
94+
if not quiet:
95+
print(" FOUND")
9596
return
9697
except Exception as e:
97-
print(f" exception fetching from S3: {e}")
98-
print(" NOT FOUND")
98+
if not quiet:
99+
print(f" exception fetching from S3: {e}")
100+
if not quiet:
101+
print(" NOT FOUND")
99102

100103
if not quiet:
101104
title = "Building mpy-cross for circuitpython " + circuitpython_tag

0 commit comments

Comments
 (0)