Skip to content

Commit 8afbdea

Browse files
committed
only animate spinner every 5s if not on a tty
1 parent fdb6c8f commit 8afbdea

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 *
@@ -117,7 +119,11 @@ def submit(self, rtlil_path, args):
117119
raise ChipFlowError(
118120
"Environment variable `CHIPFLOW_API_KEY` is empty."
119121
)
120-
with Halo(text="Submitting...", spinner="dots") as sp:
122+
if not sys.stdout.isatty():
123+
interval = 5000 # lets not animate..
124+
else:
125+
interval = -1
126+
with Halo(text="Submitting...", spinner="dots", interval=interval) as sp:
121127
fh = None
122128
submission_name = self.determine_submission_name()
123129
data = {

0 commit comments

Comments
 (0)