Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
Analysis Software
Deprecated List
Modules
Namespaces
Classes
Files
File List
acts
blob
sPHENIX
Alignment
CI
clang_tidy
commands
iwyu
physmon
check_end_of_file.py
check_fpe_masks.py
check_include_guards.py
check_license.py
check_smearing_config.py
fix_pragma.py
merge_hashes.py
perf_headwind.py
release.py
root_event_diff_np.py
util.py
cmake
Core
docs
Examples
Fatras
Plugins
Tests
acts-fatras
analysis
analysis_tpc_prototype
coresoftware
Doxygen_Assist
g4exampledetector
GenFit
JETSCAPE
KFParticle
macros
online_distribution
OnlMon
prototype
pythia6
rcdaq
RDBC
tutorials
doxygen_mainpage.h
File Members
Examples
External Links
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
util.py
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file util.py
1
import
os
2
import
contextlib
3
import
sys
4
5
try
:
6
from
halo
import
Halo
7
except
:
8
Halo =
None
9
10
11
@contextlib.contextmanager
12
def
Spinner
(text, persist=True, *args, **kwargs):
13
stream = kwargs.get(
"stream"
, sys.stdout)
14
if
stream.isatty()
and
Halo
is
not
None
:
15
spinner =
Halo
(text, *args, **kwargs)
16
spinner.start()
17
try
:
18
yield
19
if
persist:
20
spinner.succeed()
21
except
:
22
if
persist:
23
spinner.fail()
24
raise
25
finally
:
26
if
not
persist:
27
spinner.stop()
28
else
:
29
stream.write(text +
"\n"
)
30
yield
acts
blob
sPHENIX
CI
util.py
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:32
using
1.8.2 with
sPHENIX GitHub integration