Start cleaning up info field lists

This commit is contained in:
Jeff Forcier 2014-02-26 11:06:20 -08:00
parent 33452b2e6c
commit 7df1ae9602
3 changed files with 18 additions and 20 deletions

View File

@ -52,8 +52,9 @@ class AgentSSH(object):
no SSH agent was running (or it couldn't be contacted), an empty list no SSH agent was running (or it couldn't be contacted), an empty list
will be returned. will be returned.
:return: a list of keys available on the SSH agent :return:
:rtype: tuple of `.AgentKey` a tuple of `.AgentKey` objects representing keys available on the
SSH agent
""" """
return self._keys return self._keys
@ -235,7 +236,7 @@ class AgentClientProxy(object):
class AgentServerProxy(AgentSSH): class AgentServerProxy(AgentSSH):
""" """
:param t: transport used for SSH Agent communication forwarding :param .Transport t: Transport used for SSH Agent communication forwarding
:raises SSHException: mostly if we lost the agent :raises SSHException: mostly if we lost the agent
""" """
@ -273,8 +274,8 @@ class AgentServerProxy(AgentSSH):
""" """
Helper for the environnement under unix Helper for the environnement under unix
:return: the SSH_AUTH_SOCK Environnement variables :return:
:rtype: dict a dict containing the ``SSH_AUTH_SOCK`` environnement variables
""" """
env = {} env = {}
env['SSH_AUTH_SOCK'] = self._get_filename() env['SSH_AUTH_SOCK'] = self._get_filename()

View File

@ -54,8 +54,7 @@ class BufferedPipe (object):
buffer has been closed), the event will be set. When no data is buffer has been closed), the event will be set. When no data is
ready, the event will be cleared. ready, the event will be cleared.
:param event: the event to set/clear :param threading.Event event: the event to set/clear
:type event: Event
""" """
self._event = event self._event = event
if len(self._buffer) > 0: if len(self._buffer) > 0:
@ -68,8 +67,7 @@ class BufferedPipe (object):
Feed new data into this pipe. This method is assumed to be called Feed new data into this pipe. This method is assumed to be called
from a separate thread, so synchronization is done. from a separate thread, so synchronization is done.
:param data: the data to add :param data: the data to add, as a `str`
:type data: str
""" """
self._lock.acquire() self._lock.acquire()
try: try:
@ -86,9 +84,9 @@ class BufferedPipe (object):
feeder. A ``False`` result does not mean that the feeder has closed; feeder. A ``False`` result does not mean that the feeder has closed;
it means you may need to wait before more data arrives. it means you may need to wait before more data arrives.
:return: ``True`` if a `read` call would immediately return at least :return:
one byte; ``False`` otherwise. ``True`` if a `read` call would immediately return at least one
:rtype: bool byte; ``False`` otherwise.
""" """
self._lock.acquire() self._lock.acquire()
try: try:
@ -113,8 +111,7 @@ class BufferedPipe (object):
:param int nbytes: maximum number of bytes to read :param int nbytes: maximum number of bytes to read
:param float timeout: :param float timeout:
maximum seconds to wait (or ``None``, the default, to wait forever) maximum seconds to wait (or ``None``, the default, to wait forever)
:return: data :return: the read data, as a `str`
:rtype: str
:raises PipeTimeout: :raises PipeTimeout:
if a timeout was specified and no data was ready before that if a timeout was specified and no data was ready before that
@ -157,8 +154,9 @@ class BufferedPipe (object):
""" """
Clear out the buffer and return all data that was in it. Clear out the buffer and return all data that was in it.
:return: any data that was in the buffer prior to clearing it out :return:
:rtype: str any data that was in the buffer prior to clearing it out, as a
`str`
""" """
self._lock.acquire() self._lock.acquire()
try: try:
@ -188,8 +186,7 @@ class BufferedPipe (object):
""" """
Return the number of bytes buffered. Return the number of bytes buffered.
:return: number of bytes buffered :return: number (`int`) of bytes buffered
:rtype: int
""" """
self._lock.acquire() self._lock.acquire()
try: try:

View File

@ -142,8 +142,8 @@ class Channel (object):
:param height_pixels: height (in pixels) of the terminal screen :param height_pixels: height (in pixels) of the terminal screen
:type height_pixels: int :type height_pixels: int
:raises SSHException: if the request was rejected or the channel was :raises SSHException:
closed if the request was rejected or the channel was closed
""" """
if self.closed or self.eof_received or self.eof_sent or not self.active: if self.closed or self.eof_received or self.eof_sent or not self.active:
raise SSHException('Channel is not open') raise SSHException('Channel is not open')