Skip to content

Commit 3c78694

Browse files
author
Pan
committed
Updated readme, examples readme.
1 parent 25715d2 commit 3c78694

File tree

2 files changed

+38
-4
lines changed

2 files changed

+38
-4
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Super fast SSH2 protocol library. ``ssh2-python`` provides Python bindings for `
1111
:alt: Latest Version
1212
.. image:: https://travis-ci.org/ParallelSSH/ssh2-python.svg?branch=master
1313
:target: https://travis-ci.org/ParallelSSH/ssh2-python
14-
.. image:: https://ci.appveyor.com/api/projects/status/github/parallelssh/ssh2-python/branch/master?svg=true
14+
.. image:: https://ci.appveyor.com/api/projects/status/github/parallelssh/ssh2-python?svg=true&branch=master
1515
:target: https://ci.appveyor.com/project/pkittenis/ssh2-python
1616

1717
Installation

examples/README.rst

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

1719
Non-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-
3034
SFTP 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

6794
Password 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-
85114
SSH 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

Comments
 (0)