Skip to content

Commit

Permalink
Fix indentation in spheralutils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ldowen committed Jul 25, 2024
1 parent e9bd300 commit 3431eca
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 2 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ Notable changes include:
* Axom updated to v0.9.0.
* TPL builds have been split off into a separate Gitlab CI stage to help with timeouts on allocations.
* Failed ATS runs are automatically retested once in the Gitlab CI.
* Python execute command is centralized in scripts/spheralutils.py now.

* Build changes / improvements:
* Distributed source directory must always be built now.
* Git strategies in the Gitlab CI are fixed so a clone only occurs on the first stage for each job, instead of for all stages for each job.

* Bug Fixes / improvements:
* Wrappers for MPI calls are simplified and improved.
Expand Down
32 changes: 15 additions & 17 deletions scripts/spheralutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ def sexe(cmd,ret_output=False,echo=True):
print("[exe: {0}]".format(cmd))

# If we want to return the output as string a print to stdout
# in real-time we need to let subprocess print as normal to
# PIPE and STDOUT. We then need to read it back ourselves and
# in real-time we need to let subprocess print as normal to
# PIPE and STDOUT. We then need to read it back ourselves and
# append to an ouput string of our own making. There is no way
# to do this with subprocess currently.
if ret_output:
Expand All @@ -19,24 +19,22 @@ def sexe(cmd,ret_output=False,echo=True):
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
encoding='utf8')
out = "";
while True:
realtime_output = p.stdout.readline()
out = "";
while True:
realtime_output = p.stdout.readline()

if realtime_output == '' and p.poll() is not None:
break
if realtime_output == '' and p.poll() is not None:
break

if realtime_output:
print(realtime_output.strip(), flush=True)
out += realtime_output
if realtime_output:
print(realtime_output.strip(), flush=True)
out += realtime_output

if echo:
print(out)
return out

# If we do not need to return the output as a string, run()
# will suffice.
if echo:
print(out)
return out
else:
# If we do not need to return the output as a string, run()
# will suffice.
p = subprocess.run(cmd, shell=True,
check=True, text=True)

0 comments on commit 3431eca

Please sign in to comment.