Mercurial > hg > config
changeset 804:624a7fc0d7ca
this looks like something i dont need anymore (if i ever did)
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Fri, 28 Oct 2016 17:01:54 -0700 |
parents | 70e9f82c2443 |
children | 4adc11d68e3d |
files | python/logoutput.py |
diffstat | 1 files changed, 0 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- 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()