diff --git a/Changelog.rst b/Changelog.rst index 491c411b..7ddfe687 100644 --- a/Changelog.rst +++ b/Changelog.rst @@ -1,6 +1,15 @@ Change Log ============ +2.3.2 ++++++ + +Fixes +----- + +* Client output implementation Python 2 support. + + 2.3.1 +++++ diff --git a/doc/index.rst b/doc/index.rst index e9d486ca..e114b3e9 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -2,16 +2,14 @@ Parallel-SSH Documentation =========================== -.. image:: https://img.shields.io/badge/License-LGPL%20v2-blue.svg +.. image:: https://img.shields.io/badge/License-LGPL%20v2.1-blue.svg :target: https://pypi.python.org/pypi/parallel-ssh :alt: License .. image:: https://img.shields.io/pypi/v/parallel-ssh.svg :target: https://pypi.python.org/pypi/parallel-ssh :alt: Latest Version -.. image:: https://travis-ci.org/ParallelSSH/parallel-ssh.svg?branch=master - :target: https://travis-ci.org/ParallelSSH/parallel-ssh -.. image:: https://ci.appveyor.com/api/projects/status/github/parallelssh/ssh2-python?svg=true&branch=master - :target: https://ci.appveyor.com/project/pkittenis/ssh2-python +.. image:: https://circleci.com/gh/ParallelSSH/parallel-ssh/tree/master.svg?style=svg + :target: https://circleci.com/gh/ParallelSSH/parallel-ssh .. image:: https://codecov.io/gh/ParallelSSH/parallel-ssh/branch/master/graph/badge.svg :target: https://codecov.io/gh/ParallelSSH/parallel-ssh .. image:: https://img.shields.io/pypi/wheel/parallel-ssh.svg diff --git a/pssh/output.py b/pssh/output.py index 8970e8f5..128332d8 100644 --- a/pssh/output.py +++ b/pssh/output.py @@ -18,31 +18,37 @@ """Output module of ParallelSSH""" -from collections import namedtuple from os import linesep from . import logger -HostOutputBuffers = namedtuple('HostOutputBuffers', ['stdout', 'stderr'], ) -HostOutputBuffers.__doc__ = """ -:param stdout: Stdout data -:type stdout: :py:class:`BufferData` -:param stderr: Stderr data -:type stderr: :py:class:`BufferData` -""" -HostOutputBuffers.stdout.__doc__ = "Stdout :py:class:`BufferData`" -HostOutputBuffers.stderr.__doc__ = "Stderr :py:class:`BufferData`" - -BufferData = namedtuple('BufferData', ['reader', 'rw_buffer']) -BufferData.__doc__ = """ -:param reader: Reader -:type reader: :py:class:`gevent.Greenlet` -:param rw_bufffer: Read/write buffer -:type rw_buffer: :py:class:`pssh.clients.reader.ConcurrentRWBuffer` -""" -BufferData.rw_buffer.__doc__ = "Read/write buffer" -BufferData.reader.__doc__ = "Greenlet reading data from channel and writing to rw_buffer" +class HostOutputBuffers(object): + __slots__ = ('stdout', 'stderr') + + def __init__(self, stdout, stderr): + """ + :param stdout: Stdout data + :type stdout: :py:class:`BufferData` + :param stderr: Stderr data + :type stderr: :py:class:`BufferData` + """ + self.stdout = stdout + self.stderr = stderr + + +class BufferData(object): + __slots__ = ('reader', 'rw_buffer') + + def __init__(self, reader, rw_buffer): + """ + :param reader: Greenlet reading data from channel and writing to rw_buffer + :type reader: :py:class:`gevent.Greenlet` + :param rw_bufffer: Read/write buffer + :type rw_buffer: :py:class:`pssh.clients.reader.ConcurrentRWBuffer` + """ + self.reader = reader + self.rw_buffer = rw_buffer class HostOutput(object):