Home | Trees | Index | Help |
|
---|
Package pymeterlib ::
Module pyssh ::
Class Ssh
|
|
Method Summary | |
---|---|
Constructor. | |
Destructor -- close the connection. | |
Close the ssh connection by closing the input and output pipes. | |
Logs in to the ssh host. | |
Logs out the session. | |
Opens a ssh connection. | |
Reads until end of file hit. | |
Lazy read from sshout. | |
Always read at least one block, unless the connection is closed. | |
Very lazy read from sshout. | |
Sends the command 'cmd' over the ssh connection, and returns the result. | |
Handle SIGCHLD signal | |
Send text to the ssh process. |
Method Details |
---|
__init__(self,
username=None,
host='localhost',
port=None)
Constructor. This does not try to connect.
|
__del__(self)
Destructor -- close the connection.
|
close(self, addnewline=1)Close the ssh connection by closing the input and output pipes. Returns the closing messages. On Posix systems, by default it adds a newline before sending the disconnect escape sequence. Turn this off by setting addnewline=0. |
login(self, password, logintext='Last login:')Logs in to the ssh host. Checks for standard prompts, and calls the function passed as promptcb to process them. Returns the login banner, or 'None' if login process aborted. |
logout(self)Logs out the session. |
open(self, cmd=None)Opens a ssh connection. Raises an error if attempting to open an already open connection. |
read_all(self)Reads until end of file hit. May block. |
read_lazy(self)Lazy read from sshout. Waits a little, but does not block. |
read_some(self)Always read at least one block, unless the connection is closed. My block. |
read_very_lazy(self)Very lazy read from sshout. Just reads from text already queued. |
sendcmd(self, cmd, readtype=1)Sends the command 'cmd' over the ssh connection, and returns the result. By default it uses read_some, which may block. |
sig_handler(self, signum, stack)Handle SIGCHLD signal |
write(self, text)Send text to the ssh process. |
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Fri Mar 17 09:16:19 2006 | http://epydoc.sf.net |