# HG changeset patch # User Jeff Hammel # Date 1477699314 25200 # Node ID 624a7fc0d7caa9be5635e004dd2bd7f9acea48c7 # Parent 70e9f82c2443428ed0e011e738204d9e342bda8c this looks like something i dont need anymore (if i ever did) diff -r 70e9f82c2443 -r 624a7fc0d7ca python/logoutput.py --- a/python/logoutput.py Fri Oct 28 17:00:37 2016 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -#!/usr/bin/env python - -""" -execute a command and log its output to a file -""" - -import sys -from subprocess import list2cmdline, STDOUT -from subprocess import check_output as call - -def main(args=sys.argv[1:]): - """CLI""" - - usage = '%prog outputfile command [args]' - usage += '\n' + __doc__ - if args < 2: - print 'Usage: ' + usage - sys.exit(1) - - path = args.pop(0) - commandline = list2cmdline(args) - - with file(path, 'w') as w: - output = call(args, stderr=STDOUT) - w.write('\n\n'.join([commandline, output])) - -if __name__ == '__main__': - main()