Skip to content

Commit

Permalink
auto-handling of interactive sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
nsheff committed Jun 29, 2016
1 parent d3785cb commit 785f1ed
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pypiper/pypiper.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,12 @@ def start_pipeline(self, args=None, multi=False):
# Perhaps this could all just be put into __init__, but I just kind of like the idea of a start function
self.make_sure_path_exists(self.pipeline_outfolder)

if sys.__stdin__.isatty():
print("Warning: You're running an interactive python session. This works, but pypiper cannot tee\
the output, so results are only logged to screen.")

# Mirror every operation on sys.stdout to log file
if not multi:
if not multi and not sys.__stdin__.isatty():
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) # Unbuffer output

# Before creating the subprocess, we use the signal module to ignore TERM and INT signals;
Expand Down

0 comments on commit 785f1ed

Please sign in to comment.