Skip to content

Commit eb57e0f

Browse files
committed
only animate spinner every 5s if not on a tty
1 parent 02dcf9d commit eb57e0f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

chipflow_lib/steps/silicon.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
import re
99
import requests
1010
import subprocess
11+
import sys
1112
import time
1213
import urllib3
1314

15+
1416
import dotenv
1517

1618
from amaranth import *
@@ -127,7 +129,11 @@ def submit(self, rtlil_path, args):
127129
raise ChipFlowError(
128130
"Environment variable `CHIPFLOW_API_KEY` is empty."
129131
)
130-
with Halo(text="Submitting...", spinner="dots") as sp:
132+
if not sys.stdout.isatty():
133+
interval = 5000 # lets not animate..
134+
else:
135+
interval = -1
136+
with Halo(text="Submitting...", spinner="dots", interval=interval) as sp:
131137
fh = None
132138
submission_name = self.determine_submission_name()
133139
data = {

0 commit comments

Comments
 (0)