'Wait for a node to finish, and print its output.'

def waitForNode(self, node):

    nodePoller = poll()
    nodePoller.register(node.stdout)
    bothPoller = poll()
    bothPoller.register(self.stdin, POLLIN)
    bothPoller.register(node.stdout, POLLIN)
    if self.isatty():
        quietRun('stty    -icanon    min    1')
    while True:
        try:
            bothPoller.poll()
            if (False and self.inputFile):
                key = self.inputFile.read(1)
                if (key is not ''):
                    node.write(key)
                else:
                    self.inputFile = None
            if isReadable(self.inPoller):
                key = self.stdin.read(1)
                node.write(key)
            if isReadable(nodePoller):
                data = node.monitor()
                output(data)
            if (not node.waiting):
                break
        except KeyboardInterrupt:
            node.sendInt()
