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/sftp.rst | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 sites/docs/api/sftp.rst (limited to 'sites/docs/api/sftp.rst') diff --git a/sites/docs/api/sftp.rst b/sites/docs/api/sftp.rst new file mode 100644 index 00000000..1d65900a --- /dev/null +++ b/sites/docs/api/sftp.rst @@ -0,0 +1,7 @@ +paramiko.sftp module +==================== + +.. automodule:: paramiko.sftp + :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/sftp.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 09c0006a40598e224a3a925e894573d0d0cbb4c1 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Fri, 14 Feb 2014 17:17:10 -0800 Subject: Consolidate SFTP docs --- sites/docs/api/sftp.rst | 10 ++++++++-- sites/docs/api/sftp_attr.rst | 4 ---- sites/docs/api/sftp_client.rst | 4 ---- sites/docs/api/sftp_file.rst | 4 ---- sites/docs/api/sftp_handle.rst | 4 ---- sites/docs/api/sftp_server.rst | 4 ---- sites/docs/api/sftp_si.rst | 4 ---- 7 files changed, 8 insertions(+), 26 deletions(-) delete mode 100644 sites/docs/api/sftp_attr.rst delete mode 100644 sites/docs/api/sftp_client.rst delete mode 100644 sites/docs/api/sftp_file.rst delete mode 100644 sites/docs/api/sftp_handle.rst delete mode 100644 sites/docs/api/sftp_server.rst delete mode 100644 sites/docs/api/sftp_si.rst (limited to 'sites/docs/api/sftp.rst') diff --git a/sites/docs/api/sftp.rst b/sites/docs/api/sftp.rst index 731c2521..2eedecf8 100644 --- a/sites/docs/api/sftp.rst +++ b/sites/docs/api/sftp.rst @@ -1,4 +1,10 @@ -paramiko.sftp module -==================== +SFTP +==== .. automodule:: paramiko.sftp +.. automodule:: paramiko.sftp_attr +.. automodule:: paramiko.sftp_client +.. automodule:: paramiko.sftp_file +.. automodule:: paramiko.sftp_handle +.. automodule:: paramiko.sftp_server +.. automodule:: paramiko.sftp_si diff --git a/sites/docs/api/sftp_attr.rst b/sites/docs/api/sftp_attr.rst deleted file mode 100644 index 98bce03a..00000000 --- a/sites/docs/api/sftp_attr.rst +++ /dev/null @@ -1,4 +0,0 @@ -paramiko.sftp_attr module -========================= - -.. automodule:: paramiko.sftp_attr diff --git a/sites/docs/api/sftp_client.rst b/sites/docs/api/sftp_client.rst deleted file mode 100644 index 9892befe..00000000 --- a/sites/docs/api/sftp_client.rst +++ /dev/null @@ -1,4 +0,0 @@ -paramiko.sftp_client module -=========================== - -.. automodule:: paramiko.sftp_client diff --git a/sites/docs/api/sftp_file.rst b/sites/docs/api/sftp_file.rst deleted file mode 100644 index 7df6e12b..00000000 --- a/sites/docs/api/sftp_file.rst +++ /dev/null @@ -1,4 +0,0 @@ -paramiko.sftp_file module -========================= - -.. automodule:: paramiko.sftp_file diff --git a/sites/docs/api/sftp_handle.rst b/sites/docs/api/sftp_handle.rst deleted file mode 100644 index 1d1c30ed..00000000 --- a/sites/docs/api/sftp_handle.rst +++ /dev/null @@ -1,4 +0,0 @@ -paramiko.sftp_handle module -=========================== - -.. automodule:: paramiko.sftp_handle diff --git a/sites/docs/api/sftp_server.rst b/sites/docs/api/sftp_server.rst deleted file mode 100644 index 82a6976e..00000000 --- a/sites/docs/api/sftp_server.rst +++ /dev/null @@ -1,4 +0,0 @@ -paramiko.sftp_server module -=========================== - -.. automodule:: paramiko.sftp_server diff --git a/sites/docs/api/sftp_si.rst b/sites/docs/api/sftp_si.rst deleted file mode 100644 index d071e61a..00000000 --- a/sites/docs/api/sftp_si.rst +++ /dev/null @@ -1,4 +0,0 @@ -paramiko.sftp_si module -======================= - -.. automodule:: paramiko.sftp_si -- cgit v1.2.3 From 333dd249b01b059f8ecd887a515dd964bfbf7adb Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Fri, 21 Feb 2014 16:37:16 -0800 Subject: Start in on the SFTP section --- paramiko/sftp_attr.py | 4 ++-- paramiko/sftp_client.py | 18 +++++++++--------- sites/docs/api/sftp.rst | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'sites/docs/api/sftp.rst') diff --git a/paramiko/sftp_attr.py b/paramiko/sftp_attr.py index 37cdeba7..b8040399 100644 --- a/paramiko/sftp_attr.py +++ b/paramiko/sftp_attr.py @@ -26,8 +26,8 @@ class SFTPAttributes (object): """ Representation of the attributes of a file (or proxied file) for SFTP in client or server mode. It attemps to mirror the object returned by - ``os.stat`` as closely as possible, so it may have the following fields, - with the same meanings as those returned by an ``os.stat`` object: + `os.stat` as closely as possible, so it may have the following fields, + with the same meanings as those returned by an `os.stat` object: - st_size - st_uid - st_gid diff --git a/paramiko/sftp_client.py b/paramiko/sftp_client.py index d1d62233..b9d8744d 100644 --- a/paramiko/sftp_client.py +++ b/paramiko/sftp_client.py @@ -16,9 +16,6 @@ # along with Paramiko; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -""" -Client-mode SFTP support. -""" from binascii import hexlify import errno @@ -49,12 +46,13 @@ def _to_unicode(s): return s -class SFTPClient (BaseSFTP): +class SFTPClient(BaseSFTP): """ - SFTP client object. ``SFTPClient`` is used to open an sftp session across - an open ssh `.Transport` and do remote file operations. + SFTP client object. + + Used to open an SFTP session across an open SSH `.Transport` and perform + remote file operations. """ - def __init__(self, sock): """ Create an SFTP client from an existing `.Channel`. The channel @@ -782,6 +780,8 @@ class SFTPClient (BaseSFTP): return self._cwd + '/' + path -class SFTP (SFTPClient): - "an alias for `.SFTPClient` for backwards compatability" +class SFTP(SFTPClient): + """ + An alias for `.SFTPClient` for backwards compatability. + """ pass diff --git a/sites/docs/api/sftp.rst b/sites/docs/api/sftp.rst index 2eedecf8..c016d73e 100644 --- a/sites/docs/api/sftp.rst +++ b/sites/docs/api/sftp.rst @@ -2,9 +2,9 @@ SFTP ==== .. automodule:: paramiko.sftp -.. automodule:: paramiko.sftp_attr .. automodule:: paramiko.sftp_client +.. automodule:: paramiko.sftp_server +.. automodule:: paramiko.sftp_attr .. automodule:: paramiko.sftp_file .. automodule:: paramiko.sftp_handle -.. automodule:: paramiko.sftp_server .. automodule:: paramiko.sftp_si -- cgit v1.2.3 From 9ae62eb47a4f7a20eae90a7296ce0a8ecb4923b9 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Fri, 21 Feb 2014 19:15:36 -0800 Subject: Wow there's a lot of SFTP crap. --- paramiko/sftp_attr.py | 19 ++++++++-------- paramiko/sftp_client.py | 58 +++++++++++++++++++++++++------------------------ paramiko/sftp_file.py | 50 +++++++++++++++++++++++------------------- paramiko/sftp_handle.py | 4 ++-- paramiko/sftp_server.py | 6 ++--- paramiko/sftp_si.py | 20 +++++++++-------- sites/docs/api/sftp.rst | 3 +++ 7 files changed, 87 insertions(+), 73 deletions(-) (limited to 'sites/docs/api/sftp.rst') diff --git a/paramiko/sftp_attr.py b/paramiko/sftp_attr.py index b8040399..9b30829c 100644 --- a/paramiko/sftp_attr.py +++ b/paramiko/sftp_attr.py @@ -28,12 +28,13 @@ class SFTPAttributes (object): client or server mode. It attemps to mirror the object returned by `os.stat` as closely as possible, so it may have the following fields, with the same meanings as those returned by an `os.stat` object: - - st_size - - st_uid - - st_gid - - st_mode - - st_atime - - st_mtime + + - ``st_size`` + - ``st_uid`` + - ``st_gid`` + - ``st_mode`` + - ``st_atime`` + - ``st_mtime`` Because SFTP allows flags to have other arbitrary named attributes, these are stored in a dict named ``attr``. Occasionally, the filename is also @@ -61,10 +62,10 @@ class SFTPAttributes (object): def from_stat(cls, obj, filename=None): """ - Create an SFTPAttributes object from an existing ``stat`` object (an - object returned by ``os.stat``). + Create an `.SFTPAttributes` object from an existing ``stat`` object (an + object returned by `os.stat`). - :param obj: an object returned by ``os.stat`` (or equivalent). + :param obj: an object returned by `os.stat` (or equivalent). :type obj: object :param filename: the filename associated with this file. :type filename: str diff --git a/paramiko/sftp_client.py b/paramiko/sftp_client.py index b9d8744d..db8d196f 100644 --- a/paramiko/sftp_client.py +++ b/paramiko/sftp_client.py @@ -1,6 +1,6 @@ # Copyright (C) 2003-2007 Robey Pointer # -# This file is part of paramiko. +# This file is part of Paramiko. # # Paramiko is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free @@ -194,16 +194,17 @@ class SFTPClient(BaseSFTP): def open(self, filename, mode='r', bufsize=-1): """ Open a file on the remote server. The arguments are the same as for - Python's built-in ``file`` (aka ``open``). A file-like object is - returned, which closely mimics the behavior of a normal Python file - object, including the ability to be used as a context manager. + Python's built-in `python:file` (aka `python:open`). A file-like + object is returned, which closely mimics the behavior of a normal + Python file object, including the ability to be used as a context + manager. The mode indicates how the file is to be opened: ``'r'`` for reading, - ``'w'`` for writing (truncating an existing file), ``'a'`` for appending, - ``'r+'`` for reading/writing, ``'w+'`` for reading/writing (truncating an - existing file), ``'a+'`` for reading/appending. The Python ``'b'`` flag - is ignored, since SSH treats all files as binary. The ``'U'`` flag is - supported in a compatible way. + ``'w'`` for writing (truncating an existing file), ``'a'`` for + appending, ``'r+'`` for reading/writing, ``'w+'`` for reading/writing + (truncating an existing file), ``'a+'`` for reading/appending. The + Python ``'b'`` flag is ignored, since SSH treats all files as binary. + The ``'U'`` flag is supported in a compatible way. Since 1.5.2, an ``'x'`` flag indicates that the operation should only succeed if the file was created and did not previously exist. This has @@ -222,7 +223,7 @@ class SFTPClient(BaseSFTP): :param bufsize: desired buffering (-1 = default buffer size) :type bufsize: int :return: a file object representing the open file - :rtype: SFTPFile + :rtype: `.SFTPFile` :raises IOError: if the file could not be opened. """ @@ -319,16 +320,16 @@ class SFTPClient(BaseSFTP): contains fewer fields. An SFTP server may return as much or as little info as it wants, so the results may vary from server to server. - Unlike a Python ``stat`` object, the result may not be accessed as a - tuple. This is mostly due to the author's slack factor. + Unlike a Python `python:stat` object, the result may not be accessed as + a tuple. This is mostly due to the author's slack factor. - The fields supported are: ``st_mode``, ``st_size``, ``st_uid``, ``st_gid``, - ``st_atime``, and ``st_mtime``. + The fields supported are: ``st_mode``, ``st_size``, ``st_uid``, + ``st_gid``, ``st_atime``, and ``st_mtime``. :param path: the filename to stat :type path: str :return: an object containing attributes about the given file - :rtype: SFTPAttributes + :rtype: `.SFTPAttributes` """ path = self._adjust_cwd(path) self._log(DEBUG, 'stat(%r)' % path) @@ -346,7 +347,7 @@ class SFTPClient(BaseSFTP): :param path: the filename to stat :type path: str :return: an object containing attributes about the given file - :rtype: SFTPAttributes + :rtype: `.SFTPAttributes` """ path = self._adjust_cwd(path) self._log(DEBUG, 'lstat(%r)' % path) @@ -374,7 +375,7 @@ class SFTPClient(BaseSFTP): def chmod(self, path, mode): """ Change the mode (permissions) of a file. The permissions are - unix-style and identical to those used by Python's ``os.chmod`` + unix-style and identical to those used by Python's `os.chmod` function. :param path: path of the file to change the permissions of @@ -391,7 +392,7 @@ class SFTPClient(BaseSFTP): def chown(self, path, uid, gid): """ Change the owner (``uid``) and group (``gid``) of a file. As with - Python's ``os.chown`` function, you must pass both arguments, so if you + Python's `os.chown` function, you must pass both arguments, so if you only want to change one, use `stat` first to retrieve the current owner and group. @@ -433,9 +434,9 @@ class SFTPClient(BaseSFTP): def truncate(self, path, size): """ - Change the size of the file specified by ``path``. This usually extends - or shrinks the size of the file, just like the ``truncate()`` method on - Python file objects. + Change the size of the file specified by ``path``. This usually + extends or shrinks the size of the file, just like the `~file.truncate` + method on Python file objects. :param path: path of the file to modify :type path: str @@ -498,9 +499,9 @@ class SFTPClient(BaseSFTP): def chdir(self, path): """ Change the "current directory" of this SFTP session. Since SFTP - doesn't really have the concept of a current working directory, this - is emulated by paramiko. Once you use this method to set a working - directory, all operations on this SFTPClient object will be relative + doesn't really have the concept of a current working directory, this is + emulated by Paramiko. Once you use this method to set a working + directory, all operations on this `.SFTPClient` object will be relative to that path. You can pass in ``None`` to stop using a current working directory. @@ -521,7 +522,7 @@ class SFTPClient(BaseSFTP): def getcwd(self): """ Return the "current working directory" for this SFTP session, as - emulated by paramiko. If no directory has been set with `chdir`, + emulated by Paramiko. If no directory has been set with `chdir`, this method will return ``None``. :return: the current working directory on the server, or ``None`` @@ -534,7 +535,8 @@ class SFTPClient(BaseSFTP): def putfo(self, fl, remotepath, file_size=0, callback=None, confirm=True): """ Copy the contents of an open file object (``fl``) to the SFTP server as - ``remotepath``. Any exception raised by operations will be passed through. + ``remotepath``. Any exception raised by operations will be passed + through. The SFTP operations use pipelining for speed. @@ -555,7 +557,7 @@ class SFTPClient(BaseSFTP): :return: an object containing attributes about the given file (since 1.7.4) - :rtype: SFTPAttributes + :rtype: `.SFTPAttributes` .. versionadded:: 1.4 """ @@ -603,7 +605,7 @@ class SFTPClient(BaseSFTP): :return: an object containing attributes about the given file (since 1.7.4) - :rtype: SFTPAttributes + :rtype: `.SFTPAttributes` .. versionadded:: 1.4 """ diff --git a/paramiko/sftp_file.py b/paramiko/sftp_file.py index fa026ec5..068ca1a1 100644 --- a/paramiko/sftp_file.py +++ b/paramiko/sftp_file.py @@ -17,7 +17,7 @@ # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. """ -`.SFTPFile` +SFTP file object """ from __future__ import with_statement @@ -64,6 +64,9 @@ class SFTPFile (BufferedFile): self._close(async=True) def close(self): + """ + Close the file. + """ self._close(async=False) def _close(self, async=False): @@ -183,10 +186,11 @@ class SFTPFile (BufferedFile): Set a timeout on read/write operations on the underlying socket or ssh `.Channel`. - .. seealso:: `Channel.settimeout` :param timeout: seconds to wait for a pending read/write operation before raising ``socket.timeout``, or ``None`` for no timeout :type timeout: float + + .. seealso:: `.Channel.settimeout` """ self.sftp.sock.settimeout(timeout) @@ -195,8 +199,9 @@ class SFTPFile (BufferedFile): Returns the timeout in seconds (as a float) associated with the socket or ssh `.Channel` used for this file. - .. seealso:: `Channel.gettimeout` :rtype: float + + .. seealso:: `.Channel.gettimeout` """ return self.sftp.sock.gettimeout() @@ -205,10 +210,11 @@ class SFTPFile (BufferedFile): Set blocking or non-blocking mode on the underiying socket or ssh `.Channel`. - .. seealso:: `Channel.setblocking` - :param blocking: 0 to set non-blocking mode; non-0 to set blocking - mode. + :param blocking: + 0 to set non-blocking mode; non-0 to set blocking mode. :type blocking: int + + .. seealso:: `.Channel.setblocking` """ self.sftp.sock.setblocking(blocking) @@ -226,11 +232,11 @@ class SFTPFile (BufferedFile): def stat(self): """ Retrieve information about this file from the remote system. This is - exactly like `SFTP.stat`, except that it operates on an already-open - file. + exactly like `.SFTPClient.stat`, except that it operates on an + already-open file. :return: an object containing attributes about this file. - :rtype: SFTPAttributes + :rtype: `.SFTPAttributes` """ t, msg = self.sftp._request(CMD_FSTAT, self.handle) if t != CMD_ATTRS: @@ -240,7 +246,7 @@ class SFTPFile (BufferedFile): def chmod(self, mode): """ Change the mode (permissions) of this file. The permissions are - unix-style and identical to those used by Python's ``os.chmod`` + unix-style and identical to those used by Python's `os.chmod` function. :param mode: new permissions @@ -254,7 +260,7 @@ class SFTPFile (BufferedFile): def chown(self, uid, gid): """ Change the owner (``uid``) and group (``gid``) of this file. As with - Python's ``os.chown`` function, you must pass both arguments, so if you + Python's `os.chown` function, you must pass both arguments, so if you only want to change one, use `stat` first to retrieve the current owner and group. @@ -341,12 +347,12 @@ class SFTPFile (BufferedFile): concatenated together :rtype: str - .. note:: Many (most?) servers don't support this extension yet. - :raises IOError: if the server doesn't support the "check-file" extension, or possibly doesn't support the hash algorithm requested + .. note:: Many (most?) servers don't support this extension yet. + .. versionadded:: 1.4 """ t, msg = self.sftp._request(CMD_EXTENDED, 'check-file', self.handle, @@ -360,11 +366,11 @@ class SFTPFile (BufferedFile): """ Turn on/off the pipelining of write operations to this file. When pipelining is on, paramiko won't wait for the server response after - each write operation. Instead, they're collected as they come in. - At the first non-write operation (including `close`), all remaining + each write operation. Instead, they're collected as they come in. At + the first non-write operation (including `.close`), all remaining server responses are collected. This means that if there was an error - with one of your later writes, an exception might be thrown from - within `close` instead of `write`. + with one of your later writes, an exception might be thrown from within + `.close` instead of `.write`. By default, files are not pipelined. @@ -378,14 +384,14 @@ class SFTPFile (BufferedFile): def prefetch(self): """ - Pre-fetch the remaining contents of this file in anticipation of - future `read` calls. If reading the entire file, pre-fetching can + Pre-fetch the remaining contents of this file in anticipation of future + `.read` calls. If reading the entire file, pre-fetching can dramatically improve the download speed by avoiding roundtrip latency. The file's contents are incrementally buffered in a background thread. - The prefetched data is stored in a buffer until read via the `read` + The prefetched data is stored in a buffer until read via the `.read` method. Once data has been read, it's removed from the buffer. The - data may be read in a random order (using `seek`); chunks of the + data may be read in a random order (using `.seek`); chunks of the buffer that haven't been read will continue to be buffered. .. versionadded:: 1.5.1 @@ -404,7 +410,7 @@ class SFTPFile (BufferedFile): def readv(self, chunks): """ Read a set of blocks from the file by (offset, length). This is more - efficient than doing a series of `seek` and `read` calls, since the + efficient than doing a series of `.seek` and `.read` calls, since the prefetch machinery is used to retrieve all the requested blocks at once. diff --git a/paramiko/sftp_handle.py b/paramiko/sftp_handle.py index 7e1389a2..6965fd65 100644 --- a/paramiko/sftp_handle.py +++ b/paramiko/sftp_handle.py @@ -41,7 +41,7 @@ class SFTPHandle (object): SFTP. If ``flags`` is passed in, it's used to determine if the file is open in append mode. - :param flags: optional flags as passed to `SFTPServerInterface.open` + :param flags: optional flags as passed to `.SFTPServerInterface.open` :type flags: int """ self.__flags = flags @@ -149,7 +149,7 @@ class SFTPHandle (object): def stat(self): """ Return an `.SFTPAttributes` object referring to this open file, or an - error code. This is equivalent to `SFTPServerInterface.stat`, except + error code. This is equivalent to `.SFTPServerInterface.stat`, except it's called on an open file instead of a path. :return: an attributes object for the given file, or an SFTP error diff --git a/paramiko/sftp_server.py b/paramiko/sftp_server.py index c7e80c1c..9b7ed5ca 100644 --- a/paramiko/sftp_server.py +++ b/paramiko/sftp_server.py @@ -42,7 +42,7 @@ class SFTPServer (BaseSFTP, SubsystemHandler): """ Server-side SFTP subsystem support. Since this is a `.SubsystemHandler`, it can be (and is meant to be) set as the handler for ``"sftp"`` requests. - Use `Transport.set_subsystem_handler` to activate this class. + Use `.Transport.set_subsystem_handler` to activate this class. """ def __init__(self, channel, name, server, sftp_si=SFTPServerInterface, *largs, **kwargs): @@ -50,7 +50,7 @@ class SFTPServer (BaseSFTP, SubsystemHandler): The constructor for SFTPServer is meant to be called from within the `.Transport` as a subsystem handler. ``server`` and any additional parameters or keyword parameters are passed from the original call to - `Transport.set_subsystem_handler`. + `.Transport.set_subsystem_handler`. :param channel: channel passed from the `.Transport`. :type channel: `.Channel` @@ -128,7 +128,7 @@ class SFTPServer (BaseSFTP, SubsystemHandler): :param e: an errno code, as from ``OSError.errno``. :type e: int - :return: an SFTP error code like `.SFTP_NO_SUCH_FILE`. + :return: an SFTP error code like ``SFTP_NO_SUCH_FILE``. :rtype: int """ if e == errno.EACCES: diff --git a/paramiko/sftp_si.py b/paramiko/sftp_si.py index b2debd3d..ead483a0 100644 --- a/paramiko/sftp_si.py +++ b/paramiko/sftp_si.py @@ -17,7 +17,7 @@ # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. """ -`.SFTPServerInterface` is an interface to override for SFTP server support. +An interface to override for SFTP server support. """ import os @@ -64,7 +64,7 @@ class SFTPServerInterface (object): """ The SFTP server session has just ended, either cleanly or via an exception. This method is meant to be overridden to perform any - necessary cleanup before this ``SFTPServerInterface`` object is + necessary cleanup before this `.SFTPServerInterface` object is destroyed. """ pass @@ -105,7 +105,7 @@ class SFTPServerInterface (object): :param attr: requested attributes of the file if it is newly created. :type attr: `.SFTPAttributes` :return: a new `.SFTPHandle` or error code. - :rtype `.SFTPHandle` + :rtype: `.SFTPHandle` """ return SFTP_OP_UNSUPPORTED @@ -120,7 +120,7 @@ class SFTPServerInterface (object): ``os.stat``. In addition, each object should have its ``filename`` field filled in, since this is important to a directory listing and not normally present in ``os.stat`` results. The method - `SFTPAttributes.from_stat` will usually do what you want. + `.SFTPAttributes.from_stat` will usually do what you want. In case of an error, you should return one of the ``SFTP_*`` error codes, such as `.SFTP_PERMISSION_DENIED`. @@ -131,11 +131,13 @@ class SFTPServerInterface (object): `.SFTPAttributes` objects. :rtype: list of `.SFTPAttributes` or error code - .. note:: You should normalize the given ``path`` first (see the - ``os.path`` module) and check appropriate permissions before returning - the list of files. Be careful of malicious clients attempting to use - relative paths to escape restricted folders, if you're doing a direct - translation from the SFTP server path to your local filesystem. + .. note:: + You should normalize the given ``path`` first (see the `os.path` + module) and check appropriate permissions before returning the list + of files. Be careful of malicious clients attempting to use + relative paths to escape restricted folders, if you're doing a + direct translation from the SFTP server path to your local + filesystem. """ return SFTP_OP_UNSUPPORTED diff --git a/sites/docs/api/sftp.rst b/sites/docs/api/sftp.rst index c016d73e..956eada2 100644 --- a/sites/docs/api/sftp.rst +++ b/sites/docs/api/sftp.rst @@ -6,5 +6,8 @@ SFTP .. automodule:: paramiko.sftp_server .. automodule:: paramiko.sftp_attr .. automodule:: paramiko.sftp_file + :inherited-members: + :no-special-members: + :show-inheritance: .. automodule:: paramiko.sftp_handle .. automodule:: paramiko.sftp_si -- cgit v1.2.3