# HG changeset patch # User trinity_ctat # Date 1505504901 14400 # Node ID 2a3972086548d0bbcddc4b72634b7bc230bd9cb2 # Parent 1e638acde0cf8787a479c1c05450b963fee8c549 Test concatenate changes diff -r 1e638acde0cf -r 2a3972086548 bash_command_executer.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bash_command_executer.py Fri Sep 15 15:48:21 2017 -0400 @@ -0,0 +1,43 @@ +#!/usr/bin/env python + +import sys, subprocess, os + +def stop_err( msg ): + sys.stderr.write( "%s\n" % msg ) + sys.exit() + +def __main__(): + # Get command-line arguments + args = sys.argv + # Remove name of calling program, i.e. ./stderr_wrapper.py + args.pop(0) + + # If there are no arguments left, we're done + if len(args) == 0: + return + + # If one needs to silence stdout + #args.append( ">" ) + #args.append( "/dev/null" ) + + cmdline = " ".join(args) + + + try: + # Run program + err_capture = open("stderr.txt", 'w') + proc = subprocess.Popen( args=cmdline, shell=True, stderr=err_capture, stdout=sys.stdout ) + returncode = proc.wait() + err_capture.close() + + + if returncode != 0: + raise Exception + + except Exception: + # Running Grinder failed: write error message to stderr + err_text = open("stderr.txt").readlines() + stop_err( "ERROR:\n" + "\n".join(err_text)) + + +if __name__ == "__main__": __main__() diff -r 1e638acde0cf -r 2a3972086548 concatenate.xml --- a/concatenate.xml Fri Sep 15 15:28:26 2017 -0400 +++ b/concatenate.xml Fri Sep 15 15:48:21 2017 -0400 @@ -1,10 +1,11 @@ - + concatenate datasets from tail to head - + + python +