Skip to content

Disable spinner in non interactive mode

Emanuele Roberto Nocera requested to merge nospinner into master

Created by: Zaharid

Print something to the terminal instead. This avoids needlessly cluttering CI outputs.

Example

import time
import sys
import subprocess

from validphys.renametools import Spinner

with Spinner():
    time.sleep(5)

if sys.argv[-1] != "no":
    print(
        subprocess.run(
            [sys.executable, __file__, "no"], capture_output=True, text=True
        ).stdout
    )

Merge request reports

Loading