diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-07-15 14:34:27 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-07-15 14:34:27 -0500 |
commit | 1ef4e61fbb694c29d69aa98b0cf043557ac73a41 (patch) | |
tree | b2314ac8b4e3b6d13ab36cb185bdf1aa3573aa66 /displayconfig/execwithcapture.py | |
parent | e22d686a13fbb42a5d59af1873184fc7e31fc658 (diff) | |
download | tde-guidance-1ef4e61fbb694c29d69aa98b0cf043557ac73a41.tar.gz tde-guidance-1ef4e61fbb694c29d69aa98b0cf043557ac73a41.zip |
Remove thoroughly obsolete displayconfig module
Diffstat (limited to 'displayconfig/execwithcapture.py')
-rw-r--r-- | displayconfig/execwithcapture.py | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/displayconfig/execwithcapture.py b/displayconfig/execwithcapture.py deleted file mode 100644 index 10c8e23..0000000 --- a/displayconfig/execwithcapture.py +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env python - -import os -import select - -############################################################################ -def ExecWithCapture(command, argv, searchPath = 0, root = '/', stdin = 0, - catchfd = 1, closefd = -1): - - if not os.access(root + command, os.X_OK) and not searchPath: - raise RuntimeError, command + " can not be run" - - (read, write) = os.pipe() - childpid = os.fork() - if (not childpid): - if (root and root != '/'): os.chroot(root) - os.dup2(write, catchfd) - os.close(write) - os.close(read) - - if closefd != -1: - os.close(closefd) - if stdin: - os.dup2(stdin, 0) - os.close(stdin) - if searchPath: - os.execvp(command, argv) - else: - os.execv(command, argv) - sys.exit(1) - os.close(write) - - rc = "" - s = "1" - while s: - select.select([read], [], []) - s = os.read(read, 1000) - rc = rc + s - - os.close(read) - - try: - os.waitpid(childpid, 0) - except OSError, (errno, msg): - print __name__, "waitpid:", msg - - return rc |