From 2346f1a1e937f39343c2805d098b52f6c87f8fc9 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Fri, 14 Feb 2014 13:33:22 -0800 Subject: Swap out all-in-one file with sphinx-apidoc generated stuff --- sites/docs/api/client.rst | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 sites/docs/api/client.rst (limited to 'sites/docs/api/client.rst') diff --git a/sites/docs/api/client.rst b/sites/docs/api/client.rst new file mode 100644 index 00000000..50171371 --- /dev/null +++ b/sites/docs/api/client.rst @@ -0,0 +1,7 @@ +paramiko.client module +====================== + +.. automodule:: paramiko.client + :members: + :undoc-members: + :show-inheritance: -- cgit v1.2.3 From 95b5fd22559e3e24e125471a99962601b490b965 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Fri, 14 Feb 2014 15:48:39 -0800 Subject: Remove autodoc boilerplate flags from automodule directives --- sites/docs/api/agent.rst | 3 --- sites/docs/api/auth_handler.rst | 3 --- sites/docs/api/ber.rst | 3 --- sites/docs/api/buffered_pipe.rst | 3 --- sites/docs/api/channel.rst | 3 --- sites/docs/api/client.rst | 3 --- sites/docs/api/common.rst | 3 --- sites/docs/api/compress.rst | 3 --- sites/docs/api/config.rst | 3 --- sites/docs/api/dsskey.rst | 3 --- sites/docs/api/file.rst | 3 --- sites/docs/api/hostkeys.rst | 3 --- sites/docs/api/kex_gex.rst | 3 --- sites/docs/api/kex_group1.rst | 3 --- sites/docs/api/logging22.rst | 3 --- sites/docs/api/message.rst | 3 --- sites/docs/api/packet.rst | 3 --- sites/docs/api/pipe.rst | 3 --- sites/docs/api/pkey.rst | 3 --- sites/docs/api/primes.rst | 3 --- sites/docs/api/proxy.rst | 3 --- sites/docs/api/resource.rst | 3 --- sites/docs/api/rsakey.rst | 3 --- sites/docs/api/server.rst | 3 --- sites/docs/api/sftp.rst | 3 --- sites/docs/api/sftp_attr.rst | 3 --- sites/docs/api/sftp_client.rst | 3 --- sites/docs/api/sftp_file.rst | 3 --- sites/docs/api/sftp_handle.rst | 3 --- sites/docs/api/sftp_server.rst | 3 --- sites/docs/api/sftp_si.rst | 3 --- sites/docs/api/ssh_exception.rst | 3 --- sites/docs/api/transport.rst | 3 --- sites/docs/api/util.rst | 3 --- sites/docs/api/win_pageant.rst | 3 --- 35 files changed, 105 deletions(-) (limited to 'sites/docs/api/client.rst') diff --git a/sites/docs/api/agent.rst b/sites/docs/api/agent.rst index cb966f2b..26d9c97a 100644 --- a/sites/docs/api/agent.rst +++ b/sites/docs/api/agent.rst @@ -2,6 +2,3 @@ paramiko.agent module ===================== .. automodule:: paramiko.agent - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/auth_handler.rst b/sites/docs/api/auth_handler.rst index c35f5b66..0fdb490f 100644 --- a/sites/docs/api/auth_handler.rst +++ b/sites/docs/api/auth_handler.rst @@ -2,6 +2,3 @@ paramiko.auth_handler module ============================ .. automodule:: paramiko.auth_handler - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/ber.rst b/sites/docs/api/ber.rst index 3627528f..20ab604e 100644 --- a/sites/docs/api/ber.rst +++ b/sites/docs/api/ber.rst @@ -2,6 +2,3 @@ paramiko.ber module =================== .. automodule:: paramiko.ber - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/buffered_pipe.rst b/sites/docs/api/buffered_pipe.rst index 57411fc7..a8cdb581 100644 --- a/sites/docs/api/buffered_pipe.rst +++ b/sites/docs/api/buffered_pipe.rst @@ -2,6 +2,3 @@ paramiko.buffered_pipe module ============================= .. automodule:: paramiko.buffered_pipe - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/channel.rst b/sites/docs/api/channel.rst index 85848484..db8280b5 100644 --- a/sites/docs/api/channel.rst +++ b/sites/docs/api/channel.rst @@ -2,6 +2,3 @@ paramiko.channel module ======================= .. automodule:: paramiko.channel - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/client.rst b/sites/docs/api/client.rst index 50171371..840ffec8 100644 --- a/sites/docs/api/client.rst +++ b/sites/docs/api/client.rst @@ -2,6 +2,3 @@ paramiko.client module ====================== .. automodule:: paramiko.client - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/common.rst b/sites/docs/api/common.rst index 0abcf986..fb99f218 100644 --- a/sites/docs/api/common.rst +++ b/sites/docs/api/common.rst @@ -2,6 +2,3 @@ paramiko.common module ====================== .. automodule:: paramiko.common - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/compress.rst b/sites/docs/api/compress.rst index 9089efbd..93e04231 100644 --- a/sites/docs/api/compress.rst +++ b/sites/docs/api/compress.rst @@ -2,6 +2,3 @@ paramiko.compress module ======================== .. automodule:: paramiko.compress - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/config.rst b/sites/docs/api/config.rst index fb587953..dc030b48 100644 --- a/sites/docs/api/config.rst +++ b/sites/docs/api/config.rst @@ -2,6 +2,3 @@ paramiko.config module ====================== .. automodule:: paramiko.config - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/dsskey.rst b/sites/docs/api/dsskey.rst index 67fbd84e..c4d8d652 100644 --- a/sites/docs/api/dsskey.rst +++ b/sites/docs/api/dsskey.rst @@ -2,6 +2,3 @@ paramiko.dsskey module ====================== .. automodule:: paramiko.dsskey - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/file.rst b/sites/docs/api/file.rst index 044ceab0..d16c834f 100644 --- a/sites/docs/api/file.rst +++ b/sites/docs/api/file.rst @@ -2,6 +2,3 @@ paramiko.file module ==================== .. automodule:: paramiko.file - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/hostkeys.rst b/sites/docs/api/hostkeys.rst index 0428fa92..5379a369 100644 --- a/sites/docs/api/hostkeys.rst +++ b/sites/docs/api/hostkeys.rst @@ -2,6 +2,3 @@ paramiko.hostkeys module ======================== .. automodule:: paramiko.hostkeys - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/kex_gex.rst b/sites/docs/api/kex_gex.rst index 749853b3..9b5ff543 100644 --- a/sites/docs/api/kex_gex.rst +++ b/sites/docs/api/kex_gex.rst @@ -2,6 +2,3 @@ paramiko.kex_gex module ======================= .. automodule:: paramiko.kex_gex - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/kex_group1.rst b/sites/docs/api/kex_group1.rst index 8bef58d0..47089326 100644 --- a/sites/docs/api/kex_group1.rst +++ b/sites/docs/api/kex_group1.rst @@ -2,6 +2,3 @@ paramiko.kex_group1 module ========================== .. automodule:: paramiko.kex_group1 - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/logging22.rst b/sites/docs/api/logging22.rst index 55c17882..fad43489 100644 --- a/sites/docs/api/logging22.rst +++ b/sites/docs/api/logging22.rst @@ -2,6 +2,3 @@ paramiko.logging22 module ========================= .. automodule:: paramiko.logging22 - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/message.rst b/sites/docs/api/message.rst index 4f7b5838..e660ef89 100644 --- a/sites/docs/api/message.rst +++ b/sites/docs/api/message.rst @@ -2,6 +2,3 @@ paramiko.message module ======================= .. automodule:: paramiko.message - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/packet.rst b/sites/docs/api/packet.rst index 6a127d7a..ab7c6b45 100644 --- a/sites/docs/api/packet.rst +++ b/sites/docs/api/packet.rst @@ -2,6 +2,3 @@ paramiko.packet module ====================== .. automodule:: paramiko.packet - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/pipe.rst b/sites/docs/api/pipe.rst index 5ec75fa5..220dbc87 100644 --- a/sites/docs/api/pipe.rst +++ b/sites/docs/api/pipe.rst @@ -2,6 +2,3 @@ paramiko.pipe module ==================== .. automodule:: paramiko.pipe - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/pkey.rst b/sites/docs/api/pkey.rst index fb75e664..418736b7 100644 --- a/sites/docs/api/pkey.rst +++ b/sites/docs/api/pkey.rst @@ -2,6 +2,3 @@ paramiko.pkey module ==================== .. automodule:: paramiko.pkey - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/primes.rst b/sites/docs/api/primes.rst index 8dfe2a47..4d7a1f58 100644 --- a/sites/docs/api/primes.rst +++ b/sites/docs/api/primes.rst @@ -2,6 +2,3 @@ paramiko.primes module ====================== .. automodule:: paramiko.primes - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/proxy.rst b/sites/docs/api/proxy.rst index 5a0f5aff..e3cf59ca 100644 --- a/sites/docs/api/proxy.rst +++ b/sites/docs/api/proxy.rst @@ -2,6 +2,3 @@ paramiko.proxy module ===================== .. automodule:: paramiko.proxy - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/resource.rst b/sites/docs/api/resource.rst index a4527ab1..c4c548f4 100644 --- a/sites/docs/api/resource.rst +++ b/sites/docs/api/resource.rst @@ -2,6 +2,3 @@ paramiko.resource module ======================== .. automodule:: paramiko.resource - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/rsakey.rst b/sites/docs/api/rsakey.rst index 7ad995ce..77dbd894 100644 --- a/sites/docs/api/rsakey.rst +++ b/sites/docs/api/rsakey.rst @@ -2,6 +2,3 @@ paramiko.rsakey module ====================== .. automodule:: paramiko.rsakey - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/server.rst b/sites/docs/api/server.rst index 3821c9be..f59b1216 100644 --- a/sites/docs/api/server.rst +++ b/sites/docs/api/server.rst @@ -2,6 +2,3 @@ paramiko.server module ====================== .. automodule:: paramiko.server - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/sftp.rst b/sites/docs/api/sftp.rst index 1d65900a..731c2521 100644 --- a/sites/docs/api/sftp.rst +++ b/sites/docs/api/sftp.rst @@ -2,6 +2,3 @@ paramiko.sftp module ==================== .. automodule:: paramiko.sftp - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/sftp_attr.rst b/sites/docs/api/sftp_attr.rst index 114748c6..98bce03a 100644 --- a/sites/docs/api/sftp_attr.rst +++ b/sites/docs/api/sftp_attr.rst @@ -2,6 +2,3 @@ paramiko.sftp_attr module ========================= .. automodule:: paramiko.sftp_attr - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/sftp_client.rst b/sites/docs/api/sftp_client.rst index ee973df2..9892befe 100644 --- a/sites/docs/api/sftp_client.rst +++ b/sites/docs/api/sftp_client.rst @@ -2,6 +2,3 @@ paramiko.sftp_client module =========================== .. automodule:: paramiko.sftp_client - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/sftp_file.rst b/sites/docs/api/sftp_file.rst index 77756807..7df6e12b 100644 --- a/sites/docs/api/sftp_file.rst +++ b/sites/docs/api/sftp_file.rst @@ -2,6 +2,3 @@ paramiko.sftp_file module ========================= .. automodule:: paramiko.sftp_file - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/sftp_handle.rst b/sites/docs/api/sftp_handle.rst index 0f563b16..1d1c30ed 100644 --- a/sites/docs/api/sftp_handle.rst +++ b/sites/docs/api/sftp_handle.rst @@ -2,6 +2,3 @@ paramiko.sftp_handle module =========================== .. automodule:: paramiko.sftp_handle - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/sftp_server.rst b/sites/docs/api/sftp_server.rst index 50e84b18..82a6976e 100644 --- a/sites/docs/api/sftp_server.rst +++ b/sites/docs/api/sftp_server.rst @@ -2,6 +2,3 @@ paramiko.sftp_server module =========================== .. automodule:: paramiko.sftp_server - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/sftp_si.rst b/sites/docs/api/sftp_si.rst index e369d879..d071e61a 100644 --- a/sites/docs/api/sftp_si.rst +++ b/sites/docs/api/sftp_si.rst @@ -2,6 +2,3 @@ paramiko.sftp_si module ======================= .. automodule:: paramiko.sftp_si - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/ssh_exception.rst b/sites/docs/api/ssh_exception.rst index a4b6d2aa..7faaf5f4 100644 --- a/sites/docs/api/ssh_exception.rst +++ b/sites/docs/api/ssh_exception.rst @@ -2,6 +2,3 @@ paramiko.ssh_exception module ============================= .. automodule:: paramiko.ssh_exception - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/transport.rst b/sites/docs/api/transport.rst index 19fb0e88..6f5b1cd9 100644 --- a/sites/docs/api/transport.rst +++ b/sites/docs/api/transport.rst @@ -2,6 +2,3 @@ paramiko.transport module ========================= .. automodule:: paramiko.transport - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/util.rst b/sites/docs/api/util.rst index ae3eae0f..de383ae1 100644 --- a/sites/docs/api/util.rst +++ b/sites/docs/api/util.rst @@ -2,6 +2,3 @@ paramiko.util module ==================== .. automodule:: paramiko.util - :members: - :undoc-members: - :show-inheritance: diff --git a/sites/docs/api/win_pageant.rst b/sites/docs/api/win_pageant.rst index 561a5143..9b488080 100644 --- a/sites/docs/api/win_pageant.rst +++ b/sites/docs/api/win_pageant.rst @@ -2,6 +2,3 @@ paramiko.win_pageant module =========================== .. automodule:: paramiko.win_pageant - :members: - :undoc-members: - :show-inheritance: -- cgit v1.2.3 From a67142b1cae4fb04fc99df706b8b9b92337ee88f Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Fri, 14 Feb 2014 17:03:02 -0800 Subject: Moar header --- sites/docs/api/client.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sites/docs/api/client.rst') diff --git a/sites/docs/api/client.rst b/sites/docs/api/client.rst index 840ffec8..a0784d09 100644 --- a/sites/docs/api/client.rst +++ b/sites/docs/api/client.rst @@ -1,4 +1,4 @@ -paramiko.client module -====================== +Clients +======= .. automodule:: paramiko.client -- cgit v1.2.3 From d4148ab6f30fbea9d42e6999fb793a557a4d0f92 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Fri, 21 Feb 2014 10:20:57 -0800 Subject: Tweak core-class doc titles --- sites/docs/api/channel.rst | 4 ++-- sites/docs/api/client.rst | 4 ++-- sites/docs/api/message.rst | 4 ++-- sites/docs/api/packet.rst | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'sites/docs/api/client.rst') diff --git a/sites/docs/api/channel.rst b/sites/docs/api/channel.rst index 3edb8ac7..e71526f6 100644 --- a/sites/docs/api/channel.rst +++ b/sites/docs/api/channel.rst @@ -1,4 +1,4 @@ -Channels -======== +Channel +======= .. automodule:: paramiko.channel diff --git a/sites/docs/api/client.rst b/sites/docs/api/client.rst index a0784d09..1661f97d 100644 --- a/sites/docs/api/client.rst +++ b/sites/docs/api/client.rst @@ -1,4 +1,4 @@ -Clients -======= +Client +====== .. automodule:: paramiko.client diff --git a/sites/docs/api/message.rst b/sites/docs/api/message.rst index 986548b5..8d531e01 100644 --- a/sites/docs/api/message.rst +++ b/sites/docs/api/message.rst @@ -1,4 +1,4 @@ -Protocol messages -================= +Message +======= .. automodule:: paramiko.message diff --git a/sites/docs/api/packet.rst b/sites/docs/api/packet.rst index 72ad5591..4089203b 100644 --- a/sites/docs/api/packet.rst +++ b/sites/docs/api/packet.rst @@ -1,4 +1,4 @@ -Packet handling -=============== +Packetizer +========== .. automodule:: paramiko.packet -- cgit v1.2.3 From eb332c781bf26a96a472f970550938ccba118056 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Fri, 21 Feb 2014 10:21:19 -0800 Subject: Reorganize Client so API doc flows better --- paramiko/client.py | 115 +++++++++++++++++++++++----------------------- sites/docs/api/client.rst | 1 + 2 files changed, 58 insertions(+), 58 deletions(-) (limited to 'sites/docs/api/client.rst') diff --git a/paramiko/client.py b/paramiko/client.py index 19a09c2d..c7f9cfc8 100644 --- a/paramiko/client.py +++ b/paramiko/client.py @@ -17,7 +17,7 @@ # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. """ -:class:`SSHClient`. +SSH client & key policies """ from binascii import hexlify @@ -38,63 +38,6 @@ from paramiko.transport import Transport from paramiko.util import retry_on_signal -class MissingHostKeyPolicy (object): - """ - Interface for defining the policy that :class:`SSHClient` should use when the - SSH server's hostname is not in either the system host keys or the - application's keys. Pre-made classes implement policies for automatically - adding the key to the application's :class:`HostKeys` object (:class:`AutoAddPolicy`), - and for automatically rejecting the key (:class:`RejectPolicy`). - - This function may be used to ask the user to verify the key, for example. - """ - - def missing_host_key(self, client, hostname, key): - """ - Called when an :class:`SSHClient` receives a server key for a server that - isn't in either the system or local :class:`HostKeys` object. To accept - the key, simply return. To reject, raised an exception (which will - be passed to the calling application). - """ - pass - - -class AutoAddPolicy (MissingHostKeyPolicy): - """ - Policy for automatically adding the hostname and new host key to the - local :class:`HostKeys` object, and saving it. This is used by :class:`SSHClient`. - """ - - def missing_host_key(self, client, hostname, key): - client._host_keys.add(hostname, key.get_name(), key) - if client._host_keys_filename is not None: - client.save_host_keys(client._host_keys_filename) - client._log(DEBUG, 'Adding %s host key for %s: %s' % - (key.get_name(), hostname, hexlify(key.get_fingerprint()))) - - -class RejectPolicy (MissingHostKeyPolicy): - """ - Policy for automatically rejecting the unknown hostname & key. This is - used by :class:`SSHClient`. - """ - - def missing_host_key(self, client, hostname, key): - client._log(DEBUG, 'Rejecting %s host key for %s: %s' % - (key.get_name(), hostname, hexlify(key.get_fingerprint()))) - raise SSHException('Server %r not found in known_hosts' % hostname) - - -class WarningPolicy (MissingHostKeyPolicy): - """ - Policy for logging a python-style warning for an unknown host key, but - accepting it. This is used by :class:`SSHClient`. - """ - def missing_host_key(self, client, hostname, key): - warnings.warn('Unknown %s host key for %s: %s' % - (key.get_name(), hostname, hexlify(key.get_fingerprint()))) - - class SSHClient (object): """ A high-level representation of a session with an SSH server. This class @@ -536,3 +479,59 @@ class SSHClient (object): def _log(self, level, msg): self._transport._log(level, msg) + +class MissingHostKeyPolicy (object): + """ + Interface for defining the policy that :class:`SSHClient` should use when the + SSH server's hostname is not in either the system host keys or the + application's keys. Pre-made classes implement policies for automatically + adding the key to the application's :class:`HostKeys` object (:class:`AutoAddPolicy`), + and for automatically rejecting the key (:class:`RejectPolicy`). + + This function may be used to ask the user to verify the key, for example. + """ + + def missing_host_key(self, client, hostname, key): + """ + Called when an :class:`SSHClient` receives a server key for a server that + isn't in either the system or local :class:`HostKeys` object. To accept + the key, simply return. To reject, raised an exception (which will + be passed to the calling application). + """ + pass + + +class AutoAddPolicy (MissingHostKeyPolicy): + """ + Policy for automatically adding the hostname and new host key to the + local :class:`HostKeys` object, and saving it. This is used by :class:`SSHClient`. + """ + + def missing_host_key(self, client, hostname, key): + client._host_keys.add(hostname, key.get_name(), key) + if client._host_keys_filename is not None: + client.save_host_keys(client._host_keys_filename) + client._log(DEBUG, 'Adding %s host key for %s: %s' % + (key.get_name(), hostname, hexlify(key.get_fingerprint()))) + + +class RejectPolicy (MissingHostKeyPolicy): + """ + Policy for automatically rejecting the unknown hostname & key. This is + used by :class:`SSHClient`. + """ + + def missing_host_key(self, client, hostname, key): + client._log(DEBUG, 'Rejecting %s host key for %s: %s' % + (key.get_name(), hostname, hexlify(key.get_fingerprint()))) + raise SSHException('Server %r not found in known_hosts' % hostname) + + +class WarningPolicy (MissingHostKeyPolicy): + """ + Policy for logging a python-style warning for an unknown host key, but + accepting it. This is used by :class:`SSHClient`. + """ + def missing_host_key(self, client, hostname, key): + warnings.warn('Unknown %s host key for %s: %s' % + (key.get_name(), hostname, hexlify(key.get_fingerprint()))) diff --git a/sites/docs/api/client.rst b/sites/docs/api/client.rst index 1661f97d..b201812f 100644 --- a/sites/docs/api/client.rst +++ b/sites/docs/api/client.rst @@ -2,3 +2,4 @@ Client ====== .. automodule:: paramiko.client + :member-order: bysource -- cgit v1.2.3