Logo Search packages:      
Sourcecode: paramiko version File versions  Download package

def paramiko::channel::Channel::set_combine_stderr (   self,
  combine 
)

Set whether stderr should be combined into stdout on this channel.
The default is C{False}, but in some cases it may be convenient to
have both streams combined.

If this is C{False}, and L{exec_command} is called (or C{invoke_shell}
with no pty), output to stderr will not show up through the L{recv}
and L{recv_ready} calls.  You will have to use L{recv_stderr} and
L{recv_stderr_ready} to get stderr output.

If this is C{True}, data will never show up via L{recv_stderr} or
L{recv_stderr_ready}.

@param combine: C{True} if stderr output should be combined into
    stdout on this channel.
@type combine: bool
@return: previous setting.
@rtype: bool

@since: 1.1

Definition at line 368 of file channel.py.

00368                                          :
        """
        Set whether stderr should be combined into stdout on this channel.
        The default is C{False}, but in some cases it may be convenient to
        have both streams combined.
        
        If this is C{False}, and L{exec_command} is called (or C{invoke_shell}
        with no pty), output to stderr will not show up through the L{recv}
        and L{recv_ready} calls.  You will have to use L{recv_stderr} and
        L{recv_stderr_ready} to get stderr output.
        
        If this is C{True}, data will never show up via L{recv_stderr} or
        L{recv_stderr_ready}.
        
        @param combine: C{True} if stderr output should be combined into
            stdout on this channel.
        @type combine: bool
        @return: previous setting.
        @rtype: bool
        
        @since: 1.1
        """
        data = ''
        self.lock.acquire()
        try:
            old = self.combine_stderr
            self.combine_stderr = combine
            if combine and not old:
                # copy old stderr buffer into primary buffer
                data = self.in_stderr_buffer
                self.in_stderr_buffer = ''
        finally:
            self.lock.release()
        if len(data) > 0:
            self._feed(data)
        return old

    
    ###  socket API


Generated by  Doxygen 1.6.0   Back to index