@@ -11,28 +11,35 @@ Pkey from file
1111.. code-block :: shell
1212
1313 python examples/publickey_fromfile.py ~ /.ssh/id_rsa ' echo me'
14- me
1514
15+ ::
16+
17+ me
1618
1719Non-blocking execute
1820----------------------
1921
2022.. code-block :: shell
2123
2224 python examples/nonblocking_execute.py ' echo me'
25+
26+ ::
27+
2328 Would block, waiting for socket to be ready
2429 Would block, waiting for socket to be ready
2530 Waiting for command to finish
2631 Waiting for command to finish
2732 me
2833
29-
3034SFTP write
3135-----------
3236
3337.. code-block :: shell
3438
3539 python examples/sftp_write.py ~ /< my source file> ~ /< my dest file>
40+
41+ ::
42+
3643 Starting copy of local file <source file> to remote localhost:<dest file>
3744 Finished writing remote file in 0:00:00.006304
3845
@@ -44,6 +51,9 @@ SFTP read
4451.. code-block :: shell
4552
4653 python examples/sftp_read.py ~ /< remote file>
54+
55+ ::
56+
4757 Starting read for remote file <remote file>
4858 Finished file read in 0:00:00.045763
4959
@@ -55,6 +65,9 @@ Note there is no error checking and file is assumed to exist. The script will ha
5565.. code-block :: shell
5666
5767 python examples/nonblocking_sftp_read.py < remote file>
68+
69+ ::
70+
5871 Would block on sftp init, waiting for socket to be ready
5972 <..>
6073 Would block on sftp init, waiting for socket to be ready
@@ -63,6 +76,20 @@ Note there is no error checking and file is assumed to exist. The script will ha
6376 Would block on read, waiting..
6477 Finished file read in 0:00:00.056730
6578
79+ Non-blocking SFTP readdir
80+ ---------------------------
81+
82+ Print a directory listing in non-blocking mode.
83+
84+ .. code-block :: shell
85+
86+ python examples/nonblocking_sftp_readdir.py .
87+
88+ ::
89+
90+ Starting read for remote dir .
91+ Would block on readdir, waiting on socket..
92+ b'<..>'
6693
6794Password authentication
6895-------------------------
@@ -72,6 +99,9 @@ Authentication with wrong password raises ``AuthenticationError`` exception.
7299.. code-block :: shell
73100
74101 python examples/password_auth.py ' asdfadf' ' echo me'
102+
103+ ::
104+
75105 Traceback (most recent call last):
76106 File "examples/password_auth.py", line 45, in <module>
77107 main()
@@ -81,11 +111,15 @@ Authentication with wrong password raises ``AuthenticationError`` exception.
81111 raise AuthenticationError(
82112 ssh2.exceptions.AuthenticationError: ('Error authenticating user %s with password', '<user>')
83113
84-
85114SSH Agent authentication
86115--------------------------
87116
117+ Simple SSH agent authentication. The method used here is a helper function, not part of the libssh2 API, to do all the individual steps needed to retrieve, check and attempt to authenticate with an available SSH agent, raising exceptions on errors.
118+
88119.. code-block :: shell
89120
90121 python examples/agent_auth.py ' echo me'
122+
123+ ::
124+
91125 me
0 commit comments