the main methos of class Ssh in pyssh module
2012-06-12 18:28
253 查看
Package pymeterlib :: Module pyssh :: Class Ssh |
Class Ssh
A SSH connection class.Method Summary | |
---|---|
__init__(self, username, host, port) Constructor. | |
__del__(self) Destructor -- close the connection. | |
close(self, addnewline) Close the ssh connection by closing the input and output pipes. | |
login(self, password, logintext) Logs in to the ssh host. | |
logout(self) Logs out the session. | |
open(self, cmd) Opens a ssh connection. | |
read_all(self) Reads until end of file hit. | |
read_lazy(self) Lazy read from sshout. | |
read_some(self) Always read at least one block, unless the connection is closed. | |
read_very_lazy(self) Very lazy read from sshout. | |
sendcmd(self, cmd, readtype) Sends the command 'cmd' over the ssh connection, and returns the result. | |
sig_handler(self, signum, stack) Handle SIGCHLD signal | |
write(self, text) 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. |
相关文章推荐
- The distinguish of module , class when nested in ruby
- How one VBA project can use an object declared in the class module of another project
- The study of Class and Instance in Python(20170918)
- Why is the size of an empty class not zero in C++?
- Class JavaLaunchHelper is implemented in both. One of the two will be used. Which one is undefined
- How to determine the size of a class/struct in the C++?
- [经验]Class MediaTransCoder is implemented in both One of the two will be used. Which one is undefined
- The Difference of Class.forName()、Class.forName().newInstance() and New in Java
- objc[2213]: Class _NSZombie_BSXPCMessage is implemented in both ?? and ??. One of the two will be us
- The hierarchy of the type class is inconsistent
- This error is raised because the column 'type' is reserved for storing the class in case of inheritance
- Unity3d 提示 "The scripts file name does not match the name of the class defined in the script!"的解决办法
- Question 48: In C++, which of the following statements accurately describe a base class destructor calling a virtual function ov
- Question #15: Which of the following functions are found when called in main during name lookup?
- 使用slidingmeu_actionbarsherlock_lib的问题和The hierarchy of the type MainActivity is inconsistent
- the bug of the module in flex3
- Exception in thread "main" NoNodeAvailableException[None of the configured nodes are available: [{#t
- [原]openstack-kilo--issue(十九) ImportError: Could not import settings 'openstack_dashboard.settings' (Is it on sys.path? Is there an import error in the settings file?): No module named main
- objc[2213]: Class _NSZombie_BSXPCMessage is implemented in both ?? and ??. One of the two will be us
- Deprecated: main(): The Mongo class is deprecated, please use the MongoClient class in