Index: misc/py-ptyprocess/Makefile =================================================================== --- /dev/null +++ misc/py-ptyprocess/Makefile @@ -0,0 +1,23 @@ +# Created by: Johannes Jost Meixner +# $FreeBSD$ + +PORTNAME= ptyprocess +PORTVERSION= 0.4 +CATEGORIES= misc python +MASTER_SITES= CHEESESHOP +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= xmj@FreeBSD.org +COMMENT= Runs a subprocess in a pseudo terminal + +LICENSE= ISCL + +TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pytest>0:${PORTSDIR}/devel/py-pytest + +USES= python +USE_PYTHON= autoplist distutils + +regression-test: patch + cd ${WRKSRC} && ${LOCALBASE}/bin/py.test + +.include Index: misc/py-ptyprocess/distinfo =================================================================== --- /dev/null +++ misc/py-ptyprocess/distinfo @@ -0,0 +1,2 @@ +SHA256 (ptyprocess-0.4.tar.gz) = ddba719428afc4dd4f5eb37307ae753c81f89ea63f18e7d35bbb494a88fd49dc +SIZE (ptyprocess-0.4.tar.gz) = 17883 Index: misc/py-ptyprocess/files/patch-ptyprocess_ptyprocess.py =================================================================== --- /dev/null +++ misc/py-ptyprocess/files/patch-ptyprocess_ptyprocess.py @@ -0,0 +1,18 @@ +--- ptyprocess/ptyprocess.py.orig 2014-12-11 21:44:36 UTC ++++ ptyprocess/ptyprocess.py +@@ -24,7 +24,7 @@ from .util import which + _platform = sys.platform.lower() + + # Solaris uses internal __fork_pty(). All others use pty.fork(). +-_is_solaris = not ( ++_is_solaris = ( + _platform.startswith('solaris') or + _platform.startswith('sunos')) + +@@ -818,4 +818,4 @@ class PtyProcessUnicode(PtyProcess): + Returns the number of bytes written. + """ + b = s.encode(self.encoding) +- return super(PtyProcessUnicode, self).write(b) +\ No newline at end of file ++ return super(PtyProcessUnicode, self).write(b) Index: misc/py-ptyprocess/pkg-descr =================================================================== --- /dev/null +++ misc/py-ptyprocess/pkg-descr @@ -0,0 +1,10 @@ +Launch a subprocess in a pseudo terminal (pty), and interact with both the +process and its pty. + +Sometimes, piping stdin and stdout is not enough. There might be a password +prompt that doesn't read from stdin, output that changes when it's going to a +pipe rather than a terminal, or curses-style interfaces that rely on a +terminal. If you need to automate these things, running the process in a +pseudo terminal (pty) is the answer. + +WWW: http://pypi.python.org/pypi/ptyprocess