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

def paramiko::channel::Channel::invoke_shell (   self  ) 

Request an interactive shell session on this channel.  If the server
allows it, the channel will then be directly connected to the stdin,
stdout, and stderr of the shell.

Normally you would call L{get_pty} before this, in which case the
shell will operate through the pty, and the channel will be connected
to the stdin and stdout of the pty.

When the shell exits, the channel will be closed and can't be reused.
You must open a new channel if you wish to open another shell.

@return: C{True} if the operation succeeded; C{False} if not.
@rtype: bool

Definition at line 158 of file channel.py.

00158                           :
        """
        Request an interactive shell session on this channel.  If the server
        allows it, the channel will then be directly connected to the stdin,
        stdout, and stderr of the shell.
        
        Normally you would call L{get_pty} before this, in which case the
        shell will operate through the pty, and the channel will be connected
        to the stdin and stdout of the pty.
        
        When the shell exits, the channel will be closed and can't be reused.
        You must open a new channel if you wish to open another shell.
        
        @return: C{True} if the operation succeeded; C{False} if not.
        @rtype: bool
        """
        if self.closed or self.eof_received or self.eof_sent or not self.active:
            raise SSHException('Channel is not open')
        m = Message()
        m.add_byte(chr(MSG_CHANNEL_REQUEST))
        m.add_int(self.remote_chanid)
        m.add_string('shell')
        m.add_boolean(1)
        self.event.clear()
        self.transport._send_user_message(m)
        while True:
            self.event.wait(0.1)
            if self.closed:
                return False
            if self.event.isSet():
                return True

    def exec_command(self, command):


Generated by  Doxygen 1.6.0   Back to index