http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/6a81d1e7/env2/lib/python2.7/site-packages/docker_py-1.10.6.dist-info/RECORD ---------------------------------------------------------------------- diff --git a/env2/lib/python2.7/site-packages/docker_py-1.10.6.dist-info/RECORD b/env2/lib/python2.7/site-packages/docker_py-1.10.6.dist-info/RECORD deleted file mode 100644 index 38dd04f..0000000 --- a/env2/lib/python2.7/site-packages/docker_py-1.10.6.dist-info/RECORD +++ /dev/null @@ -1,79 +0,0 @@ -docker/__init__.py,sha256=t4Je1DhG_m_o8j3KttwsAPIA1lZPvByNUL5McbDBXSA,162 -docker/client.py,sha256=Dr6hvbHjSoKDWFaY_izh7rNjKTPitZtS9bYUt7aoFMM,14505 -docker/constants.py,sha256=9ydLQmdHPeAbg7Xzwm1mHqF-I08Oqard-C7uF17FbTE,489 -docker/errors.py,sha256=Xq8KWvTajV24k0KYQCC4eT2qo4Fz18vw2cW-5FWATNI,1871 -docker/tls.py,sha256=u7eNySocRScoMjKPGIr4zRawfwuh4DHl7-4lSy2MQ5c,2595 -docker/version.py,sha256=z0Q4ivcptJ75GrSGMNQznFmPEoAV_RRbmxSz6rXdd3U,92 -docker/api/__init__.py,sha256=3aLcftoC-ejG5Dw7XRX1gLEAJ-TNY2R-_P28yYIGAvM,334 -docker/api/build.py,sha256=49zeu31gxM9iZtDtch1TyqK4c-lLAmjUEW7tSnewarM,5157 -docker/api/container.py,sha256=VA1c3Rusk7GStimvJkE7f-eVSbyw6iuLGa1-2aOo0lU,17124 -docker/api/daemon.py,sha256=TJonPi8WIn6IhDRTPUdqlyJ3xDhz74xMWk0BDlQAPCM,2679 -docker/api/exec_api.py,sha256=Q5HkF9DpEueV6Y0IY-Wv_aEudxoyEG4t1VtuoF5h29s,2556 -docker/api/image.py,sha256=iJ9iYqzWxdBwXfhcUbWw2K3-KAa01WTMVkrq5fQKM0Q,8886 -docker/api/network.py,sha256=5GBNi62PBfTSV2IerogKFGcbB4cWYglX8eJ3jAj3TZ4,3720 -docker/api/service.py,sha256=v5dWek01JO2YsObapXLCpw5H6lPUCNGvrrSIps71M4w,3760 -docker/api/swarm.py,sha256=VczPgYNSPoPZ5Vfxqx9SL0wPpNjjoARRQ5vJ1HPCSX8,2679 -docker/api/volume.py,sha256=SdV_PiZ1D22hQ0oyUyPreZHgkGYe7jloZFKfYmyHNg0,1562 -docker/auth/__init__.py,sha256=7bj7rEAuDg5z9heROSFC075-FWCJcUrNeCEpKNcBYJ4,157 -docker/auth/auth.py,sha256=YQzwhVKH2yQhap5pBH6-3rer-FIccDo5wFHAae-3Jio,9949 -docker/ssladapter/__init__.py,sha256=Es-OKMX3UouN-l1kZolFJhPdzgQZ11hCs1cEfxCZ-kg,50 -docker/ssladapter/ssladapter.py,sha256=HHrS1275s3RlqW07NVYfwOiz7u21mSQEw8ep-JJ65Nk,2355 -docker/transport/__init__.py,sha256=D4-MAqRUIow4T54yHyrENEsmAl01eKk1cknBgTKIhsE,163 -docker/transport/npipeconn.py,sha256=7RSNjoLxcaoc3vgmcB-IqY7tptlaIG7VQ6ac-ZJvnr4,3260 -docker/transport/npipesocket.py,sha256=tV8LvkgxSFjfjaWwT96Bdp6JJCSt-iy7aHtB1VdzNAU,5856 -docker/transport/unixconn.py,sha256=9aTPjdRQh1SIrvUyDZMneRP7Dgb4-5yPFlRkR3oaz78,2674 -docker/types/__init__.py,sha256=izknOdpwO8FsszlLsw-GNwMo0TWj-FzqpvmdeHB5lW4,226 -docker/types/base.py,sha256=piWvrWGsYC7GAm6QdfkDmwG90jcYc7ROaNCHLejbzpQ,130 -docker/types/containers.py,sha256=Plw4J9tNcYTHmQEOwdvprW992yRFq1UhIK8um6XLNfk,2213 -docker/types/services.py,sha256=MQPSBDefO-JbkunFGX-tHjHbB9kJ6qaHBNXVaPe5ySU,5715 -docker/types/swarm.py,sha256=eYtjT3OlAGR1I0QJpIbCqDNjQ8S9sz8l4RCfXK5Syr8,1590 -docker/utils/__init__.py,sha256=rdIH3Nhtwi0ky9lDgWLwizwRWe2pnp3gTmtxRWzUHlY,628 -docker/utils/decorators.py,sha256=LdmBeFNnBiD406cbaSwG7R8_OBBchBsK9BTvKxQnJ6w,1546 -docker/utils/socket.py,sha256=mYlzmYhLv8l5FqL3-EzeDLqWB-JysS54TCImRwNmrpQ,1685 -docker/utils/types.py,sha256=gMFyrx0THXa7BOB-cSQBsPsxggatwYcJkRjKHwpLMRg,220 -docker/utils/utils.py,sha256=V8lPg34rQn519NsgGwuArq_TznOVPotPXCF9S4F3KAg,35969 -docker/utils/ports/__init__.py,sha256=WVp6voMB16-Og9Ry_lDi4rhn6SczIRfJR3nA5cIG8C4,78 -docker/utils/ports/ports.py,sha256=eermjlGxh3BaJgtBgQ-XadC_ywzFEhA6ETd6NgRJHoE,2847 -docker_py-1.10.6.dist-info/DESCRIPTION.rst,sha256=eOjNMoycF5k24eRWoTGkX1ye2WnjvEesrNBw7AzrnaI,914 -docker_py-1.10.6.dist-info/METADATA,sha256=DGvMTavLSX8T7-C3fbSSYR4KHtYnri_UMuQmrlexc8I,2091 -docker_py-1.10.6.dist-info/RECORD,, -docker_py-1.10.6.dist-info/WHEEL,sha256=GrqQvamwgBV4nLoJe0vhYRSWzWsx7xjlt74FT0SWYfE,110 -docker_py-1.10.6.dist-info/metadata.json,sha256=ZrIbltkadLOjIe0JZG6FEev1KqQFv0VW9BXzpcHwXLM,1417 -docker_py-1.10.6.dist-info/top_level.txt,sha256=ANFR59OS5o4sdWpvxCZAAG3cCpjTfbo_kKe3P2MYi70,7 -docker_py-1.10.6.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 -docker/types/containers.pyc,, -docker/ssladapter/__init__.pyc,, -docker/api/swarm.pyc,, -docker/types/swarm.pyc,, -docker/version.pyc,, -docker/auth/auth.pyc,, -docker/utils/types.pyc,, -docker/client.pyc,, -docker/tls.pyc,, -docker/utils/ports/ports.pyc,, -docker/api/exec_api.pyc,, -docker/types/__init__.pyc,, -docker/errors.pyc,, -docker/api/__init__.pyc,, -docker/auth/__init__.pyc,, -docker/api/image.pyc,, -docker/types/services.pyc,, -docker/constants.pyc,, -docker/api/build.pyc,, -docker/api/service.pyc,, -docker/utils/__init__.pyc,, -docker/transport/npipesocket.pyc,, -docker/utils/utils.pyc,, -docker/api/daemon.pyc,, -docker/transport/unixconn.pyc,, -docker/utils/ports/__init__.pyc,, -docker/types/base.pyc,, -docker/api/container.pyc,, -docker/transport/__init__.pyc,, -docker/utils/socket.pyc,, -docker/api/network.pyc,, -docker/api/volume.pyc,, -docker/ssladapter/ssladapter.pyc,, -docker/transport/npipeconn.pyc,, -docker/__init__.pyc,, -docker/utils/decorators.pyc,,
http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/6a81d1e7/env2/lib/python2.7/site-packages/docker_py-1.10.6.dist-info/WHEEL ---------------------------------------------------------------------- diff --git a/env2/lib/python2.7/site-packages/docker_py-1.10.6.dist-info/WHEEL b/env2/lib/python2.7/site-packages/docker_py-1.10.6.dist-info/WHEEL deleted file mode 100644 index 0de529b..0000000 --- a/env2/lib/python2.7/site-packages/docker_py-1.10.6.dist-info/WHEEL +++ /dev/null @@ -1,6 +0,0 @@ -Wheel-Version: 1.0 -Generator: bdist_wheel (0.26.0) -Root-Is-Purelib: true -Tag: py2-none-any -Tag: py3-none-any - http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/6a81d1e7/env2/lib/python2.7/site-packages/docker_py-1.10.6.dist-info/metadata.json ---------------------------------------------------------------------- diff --git a/env2/lib/python2.7/site-packages/docker_py-1.10.6.dist-info/metadata.json b/env2/lib/python2.7/site-packages/docker_py-1.10.6.dist-info/metadata.json deleted file mode 100644 index bed6f3a..0000000 --- a/env2/lib/python2.7/site-packages/docker_py-1.10.6.dist-info/metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"generator": "bdist_wheel (0.26.0)", "summary": "Python client for Docker.", "classifiers": ["Development Status :: 4 - Beta", "Environment :: Other Environment", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Utilities", "License :: OSI Approved :: Apache Software License"], "extensions": {"python.details": {"project_urls": {"Home": "https://github.com/docker/docker-py/"}, "contacts": [{"email": "joff...@docker.com", "name": "Joffrey F", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}}}, "metadata_version": "2.0", "name": "docker-py", "run_requires": [{"requires": ["backports.ssl-match-hostname (>=3.5)"], "env ironment": "python_version < \"3.5\""}, {"requires": ["docker-pycreds (>=0.2.1)", "requests (>=2.5.2,!=2.11.0)", "six (>=1.4.0)", "websocket-client (>=0.32.0)"]}, {"requires": ["ipaddress (>=1.0.16)"], "environment": "python_version < \"3.3\""}], "extras": [], "version": "1.10.6", "test_requires": [{"requires": ["coverage (==3.7.1)", "flake8 (==2.4.1)", "mock (==1.0.1)", "pytest (==2.9.1)", "pytest-cov (==2.1.0)"]}]} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/6a81d1e7/env2/lib/python2.7/site-packages/docker_py-1.10.6.dist-info/top_level.txt ---------------------------------------------------------------------- diff --git a/env2/lib/python2.7/site-packages/docker_py-1.10.6.dist-info/top_level.txt b/env2/lib/python2.7/site-packages/docker_py-1.10.6.dist-info/top_level.txt deleted file mode 100644 index bdb9670..0000000 --- a/env2/lib/python2.7/site-packages/docker_py-1.10.6.dist-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -docker http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/6a81d1e7/env2/lib/python2.7/site-packages/docker_pycreds-0.2.1.dist-info/DESCRIPTION.rst ---------------------------------------------------------------------- diff --git a/env2/lib/python2.7/site-packages/docker_pycreds-0.2.1.dist-info/DESCRIPTION.rst b/env2/lib/python2.7/site-packages/docker_pycreds-0.2.1.dist-info/DESCRIPTION.rst deleted file mode 100644 index e118723..0000000 --- a/env2/lib/python2.7/site-packages/docker_pycreds-0.2.1.dist-info/DESCRIPTION.rst +++ /dev/null @@ -1,3 +0,0 @@ -UNKNOWN - - http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/6a81d1e7/env2/lib/python2.7/site-packages/docker_pycreds-0.2.1.dist-info/INSTALLER ---------------------------------------------------------------------- diff --git a/env2/lib/python2.7/site-packages/docker_pycreds-0.2.1.dist-info/INSTALLER b/env2/lib/python2.7/site-packages/docker_pycreds-0.2.1.dist-info/INSTALLER deleted file mode 100644 index a1b589e..0000000 --- a/env2/lib/python2.7/site-packages/docker_pycreds-0.2.1.dist-info/INSTALLER +++ /dev/null @@ -1 +0,0 @@ -pip http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/6a81d1e7/env2/lib/python2.7/site-packages/docker_pycreds-0.2.1.dist-info/METADATA ---------------------------------------------------------------------- diff --git a/env2/lib/python2.7/site-packages/docker_pycreds-0.2.1.dist-info/METADATA b/env2/lib/python2.7/site-packages/docker_pycreds-0.2.1.dist-info/METADATA deleted file mode 100644 index a4e7ea5..0000000 --- a/env2/lib/python2.7/site-packages/docker_pycreds-0.2.1.dist-info/METADATA +++ /dev/null @@ -1,28 +0,0 @@ -Metadata-Version: 2.0 -Name: docker-pycreds -Version: 0.2.1 -Summary: Python bindings for the docker credentials store API -Home-page: https://github.com/shin-/docker-pycreds/ -Author: UNKNOWN -Author-email: UNKNOWN -License: UNKNOWN -Platform: UNKNOWN -Classifier: Development Status :: 4 - Beta -Classifier: Environment :: Other Environment -Classifier: Intended Audience :: Developers -Classifier: Operating System :: OS Independent -Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.6 -Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.3 -Classifier: Programming Language :: Python :: 3.4 -Classifier: Programming Language :: Python :: 3.5 -Classifier: Topic :: Utilities -Classifier: License :: OSI Approved :: Apache Software License -Requires-Dist: six (>=1.4.0) - -UNKNOWN - - http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/6a81d1e7/env2/lib/python2.7/site-packages/docker_pycreds-0.2.1.dist-info/RECORD ---------------------------------------------------------------------- diff --git a/env2/lib/python2.7/site-packages/docker_pycreds-0.2.1.dist-info/RECORD b/env2/lib/python2.7/site-packages/docker_pycreds-0.2.1.dist-info/RECORD deleted file mode 100644 index cac0354..0000000 --- a/env2/lib/python2.7/site-packages/docker_pycreds-0.2.1.dist-info/RECORD +++ /dev/null @@ -1,17 +0,0 @@ -dockerpycreds/store.py,sha256=JxQk6DsvxJ9JdvWB_N-HIVnBGKi1dFNsNgGEh_SVvTs,2685 -dockerpycreds/errors.py,sha256=YA3PKOTLprJwXxfIzkwdOhZfqN8fJUqu33S5_WCFNTo,526 -dockerpycreds/__init__.py,sha256=vdD-zY6geCywLcpf8Naplshb5a5dc8czaWtbL7VdEDE,116 -dockerpycreds/version.py,sha256=LceYuk9x56jy-Jp8UONWdcbW02L9GUYiwEfRbVDT8oE,91 -dockerpycreds/constants.py,sha256=tMFxMwBliNpWDUE2RQPWq79dWoub8WIEBa0a40UaWHk,110 -docker_pycreds-0.2.1.dist-info/top_level.txt,sha256=iHN9Ul5VnNovfI4c7fel4nGnEtE4BezC_IQ8_3meRVw,14 -docker_pycreds-0.2.1.dist-info/WHEEL,sha256=AvR0WeTpDaxT645bl5FQxUK6NPsTls2ttpcGJg3j1Xg,110 -docker_pycreds-0.2.1.dist-info/METADATA,sha256=Ef4mjNnlrFUQ1b08iwzR1-80sLN3wvIlIGXCLnLetKk,947 -docker_pycreds-0.2.1.dist-info/RECORD,, -docker_pycreds-0.2.1.dist-info/DESCRIPTION.rst,sha256=OCTuuN6LcWulhHS3d5rfjdsQtW22n7HENFRh6jC6ego,10 -docker_pycreds-0.2.1.dist-info/metadata.json,sha256=RqsYE796pcQgeuW7WCpiXIIMatOvP9OvFkbrEei-5us,1054 -docker_pycreds-0.2.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 -dockerpycreds/errors.pyc,, -dockerpycreds/__init__.pyc,, -dockerpycreds/store.pyc,, -dockerpycreds/version.pyc,, -dockerpycreds/constants.pyc,, http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/6a81d1e7/env2/lib/python2.7/site-packages/docker_pycreds-0.2.1.dist-info/WHEEL ---------------------------------------------------------------------- diff --git a/env2/lib/python2.7/site-packages/docker_pycreds-0.2.1.dist-info/WHEEL b/env2/lib/python2.7/site-packages/docker_pycreds-0.2.1.dist-info/WHEEL deleted file mode 100644 index 9dff69d..0000000 --- a/env2/lib/python2.7/site-packages/docker_pycreds-0.2.1.dist-info/WHEEL +++ /dev/null @@ -1,6 +0,0 @@ -Wheel-Version: 1.0 -Generator: bdist_wheel (0.24.0) -Root-Is-Purelib: true -Tag: py2-none-any -Tag: py3-none-any - http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/6a81d1e7/env2/lib/python2.7/site-packages/docker_pycreds-0.2.1.dist-info/metadata.json ---------------------------------------------------------------------- diff --git a/env2/lib/python2.7/site-packages/docker_pycreds-0.2.1.dist-info/metadata.json b/env2/lib/python2.7/site-packages/docker_pycreds-0.2.1.dist-info/metadata.json deleted file mode 100644 index 088be6b..0000000 --- a/env2/lib/python2.7/site-packages/docker_pycreds-0.2.1.dist-info/metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"name": "docker-pycreds", "metadata_version": "2.0", "generator": "bdist_wheel (0.24.0)", "test_requires": [{"requires": ["pytest (==3.0.2)", "flake8 (==2.4.1)", "pytest-cov (==2.3.1)"]}], "summary": "Python bindings for the docker credentials store API", "run_requires": [{"requires": ["six (>=1.4.0)"]}], "version": "0.2.1", "extensions": {"python.details": {"project_urls": {"Home": "https://github.com/shin-/docker-pycreds/"}, "document_names": {"description": "DESCRIPTION.rst"}}}, "classifiers": ["Development Status :: 4 - Beta", "Environment :: Other Environment", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Utilities", "License :: OSI Approved :: Apache Software License"], "extras": []} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/6a81d1e7/env2/lib/python2.7/site-packages/docker_pycreds-0.2.1.dist-info/top_level.txt ---------------------------------------------------------------------- diff --git a/env2/lib/python2.7/site-packages/docker_pycreds-0.2.1.dist-info/top_level.txt b/env2/lib/python2.7/site-packages/docker_pycreds-0.2.1.dist-info/top_level.txt deleted file mode 100644 index 0628bf7..0000000 --- a/env2/lib/python2.7/site-packages/docker_pycreds-0.2.1.dist-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -dockerpycreds http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/6a81d1e7/env2/lib/python2.7/site-packages/dockerpty-0.4.1.dist-info/DESCRIPTION.rst ---------------------------------------------------------------------- diff --git a/env2/lib/python2.7/site-packages/dockerpty-0.4.1.dist-info/DESCRIPTION.rst b/env2/lib/python2.7/site-packages/dockerpty-0.4.1.dist-info/DESCRIPTION.rst deleted file mode 100644 index 81ac547..0000000 --- a/env2/lib/python2.7/site-packages/dockerpty-0.4.1.dist-info/DESCRIPTION.rst +++ /dev/null @@ -1,131 +0,0 @@ -# Docker PTY - -Provides the functionality needed to operate the pseudo-tty (PTY) allocated to -a docker container, using the Python client. - -[![Build Status](https://travis-ci.org/d11wtq/dockerpty.svg?branch=master)] -(https://travis-ci.org/d11wtq/dockerpty) - -## Installation - -Via pip: - -``` -pip install dockerpty -``` - -Dependencies: - - * docker-py>=0.3.2 - -However, this library does not explicitly declare this dependency in PyPi for a -number of reasons. It is assumed you have it installed. - -## Usage - -The following example will run busybox in a docker container and place the user -at the shell prompt via Python. - -This obviously only works when run in a terminal. - -``` python -import docker -import dockerpty - -client = docker.Client() -container = client.create_container( - image='busybox:latest', - stdin_open=True, - tty=True, - command='/bin/sh', -) - -dockerpty.start(client, container) -``` - -Keyword arguments passed to `start()` will be forwarded onto the client to -start the container. - -When the dockerpty is started, control is yielded to the container's PTY until -the container exits, or the container's PTY is closed. - -This is a safe operation and all resources are restored back to their original -states. - -> **Note:** dockerpty does support attaching to non-tty containers to stream -container output, though it is obviously not possible to 'control' the -container if you do not allocate a pseudo-tty. - -If you press `C-p C-q`, the container's PTY will be closed, but the container -will keep running. In other words, you will have detached from the container -and can re-attach with another `dockerpty.start()` call. - -## Tests - -If you want to hack on dockerpty and send a PR, you'll need to run the tests. -In the features/ directory, are features/user stories for how dockerpty is -supposed to work. To run them: - -``` --bash$ pip install -r requirements-dev.txt --bash$ behave features/ -``` - -You'll need to have docker installed and running locally. The tests use busybox -container as a test fixture, so are not too heavy. - -Step definitions are defined in features/steps/. - -There are also unit tests for the parts of the code that are not inherently -dependent on controlling a TTY. To run those: - -``` --bash$ pip install -r requirements-dev.txt --bash$ py.test tests/ -``` - -Travis CI runs this build inside a UML kernel that is new enough to run docker. -Your PR will need to pass the build before I can merge it. - - - Travis CI build: https://travis-ci.org/d11wtq/dockerpty - -## How it works - -In a terminal, the three file descriptors stdin, stdout and stderr are all -connected to the controlling terminal (TTY). When you pass the `tty=True` flag -to docker's `create_container()`, docker allocates a fake TTY inside the -container (a PTY) to which the container's stdin, stdout and stderr are all -connected. - -The docker API provides a way to access the three sockets connected to the PTY. -If with access to the host system's TTY file descriptors and the container's -PTY file descriptors, it is trivial to simply 'pipe' data written to these file -descriptors between the host and the container. Doing this makes the user's -terminal effectively become the pseudo-terminal from inside the container. - -In reality it's a bit more complicated than this, since care must be taken to -put the host terminal into raw mode (where keys such as enter are not -interpreted with any special meaning) and restore it on exit. Additionally, the -container's stdout and stderr streams along with `sys.stdin` must be made -non-blocking so that they can be used with `select()` without blocking the main -process. These attributes are restored on exit. - -The size of a terminal cannot be controlled by sending data to stdin and can -only be controlled by the terminal program itself. Since the pseudo-terminal is -running inside a real terminal, it is import that the size of the PTY be kept -the same as that of the presenting TTY. For this reason, docker provides an API -call to resize the allocated PTY. A SIGWINCH handler is used to detect window -size changes and resize the pseudo-terminal as needed. - -## Contributors - - - Primary author: [Chris Corbyn](https://github.com/d11wtq) - - Collaborator: [Daniel Nephin](https://github.com/dnephin) - - Contributor: [Stephen Moore](https://github.com/delfick) - - Contributor: [Ben Firshman](https://github.com/bfirsh) - -## Copyright & Licensing - -Copyright © 2014 Chris Corbyn. See the LICENSE.txt file for details. - - http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/6a81d1e7/env2/lib/python2.7/site-packages/dockerpty-0.4.1.dist-info/INSTALLER ---------------------------------------------------------------------- diff --git a/env2/lib/python2.7/site-packages/dockerpty-0.4.1.dist-info/INSTALLER b/env2/lib/python2.7/site-packages/dockerpty-0.4.1.dist-info/INSTALLER deleted file mode 100644 index a1b589e..0000000 --- a/env2/lib/python2.7/site-packages/dockerpty-0.4.1.dist-info/INSTALLER +++ /dev/null @@ -1 +0,0 @@ -pip http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/6a81d1e7/env2/lib/python2.7/site-packages/dockerpty-0.4.1.dist-info/METADATA ---------------------------------------------------------------------- diff --git a/env2/lib/python2.7/site-packages/dockerpty-0.4.1.dist-info/METADATA b/env2/lib/python2.7/site-packages/dockerpty-0.4.1.dist-info/METADATA deleted file mode 100644 index 90929d3..0000000 --- a/env2/lib/python2.7/site-packages/dockerpty-0.4.1.dist-info/METADATA +++ /dev/null @@ -1,152 +0,0 @@ -Metadata-Version: 2.0 -Name: dockerpty -Version: 0.4.1 -Summary: Python library to use the pseudo-tty of a docker container -Home-page: https://github.com/d11wtq/dockerpty -Author: Chris Corbyn -Author-email: ch...@w3style.co.uk -License: Apache 2.0 -Keywords: docker,tty,pty,terminal -Platform: UNKNOWN -Classifier: Development Status :: 4 - Beta -Classifier: License :: OSI Approved :: Apache Software License -Classifier: Programming Language :: Python -Classifier: Environment :: Console -Classifier: Intended Audience :: Developers -Classifier: Topic :: Terminals -Classifier: Topic :: Terminals :: Terminal Emulators/X Terminals -Classifier: Topic :: Software Development :: Libraries -Classifier: Topic :: Software Development :: Libraries :: Python Modules -Requires-Dist: six (>=1.3.0) - -# Docker PTY - -Provides the functionality needed to operate the pseudo-tty (PTY) allocated to -a docker container, using the Python client. - -[![Build Status](https://travis-ci.org/d11wtq/dockerpty.svg?branch=master)] -(https://travis-ci.org/d11wtq/dockerpty) - -## Installation - -Via pip: - -``` -pip install dockerpty -``` - -Dependencies: - - * docker-py>=0.3.2 - -However, this library does not explicitly declare this dependency in PyPi for a -number of reasons. It is assumed you have it installed. - -## Usage - -The following example will run busybox in a docker container and place the user -at the shell prompt via Python. - -This obviously only works when run in a terminal. - -``` python -import docker -import dockerpty - -client = docker.Client() -container = client.create_container( - image='busybox:latest', - stdin_open=True, - tty=True, - command='/bin/sh', -) - -dockerpty.start(client, container) -``` - -Keyword arguments passed to `start()` will be forwarded onto the client to -start the container. - -When the dockerpty is started, control is yielded to the container's PTY until -the container exits, or the container's PTY is closed. - -This is a safe operation and all resources are restored back to their original -states. - -> **Note:** dockerpty does support attaching to non-tty containers to stream -container output, though it is obviously not possible to 'control' the -container if you do not allocate a pseudo-tty. - -If you press `C-p C-q`, the container's PTY will be closed, but the container -will keep running. In other words, you will have detached from the container -and can re-attach with another `dockerpty.start()` call. - -## Tests - -If you want to hack on dockerpty and send a PR, you'll need to run the tests. -In the features/ directory, are features/user stories for how dockerpty is -supposed to work. To run them: - -``` --bash$ pip install -r requirements-dev.txt --bash$ behave features/ -``` - -You'll need to have docker installed and running locally. The tests use busybox -container as a test fixture, so are not too heavy. - -Step definitions are defined in features/steps/. - -There are also unit tests for the parts of the code that are not inherently -dependent on controlling a TTY. To run those: - -``` --bash$ pip install -r requirements-dev.txt --bash$ py.test tests/ -``` - -Travis CI runs this build inside a UML kernel that is new enough to run docker. -Your PR will need to pass the build before I can merge it. - - - Travis CI build: https://travis-ci.org/d11wtq/dockerpty - -## How it works - -In a terminal, the three file descriptors stdin, stdout and stderr are all -connected to the controlling terminal (TTY). When you pass the `tty=True` flag -to docker's `create_container()`, docker allocates a fake TTY inside the -container (a PTY) to which the container's stdin, stdout and stderr are all -connected. - -The docker API provides a way to access the three sockets connected to the PTY. -If with access to the host system's TTY file descriptors and the container's -PTY file descriptors, it is trivial to simply 'pipe' data written to these file -descriptors between the host and the container. Doing this makes the user's -terminal effectively become the pseudo-terminal from inside the container. - -In reality it's a bit more complicated than this, since care must be taken to -put the host terminal into raw mode (where keys such as enter are not -interpreted with any special meaning) and restore it on exit. Additionally, the -container's stdout and stderr streams along with `sys.stdin` must be made -non-blocking so that they can be used with `select()` without blocking the main -process. These attributes are restored on exit. - -The size of a terminal cannot be controlled by sending data to stdin and can -only be controlled by the terminal program itself. Since the pseudo-terminal is -running inside a real terminal, it is import that the size of the PTY be kept -the same as that of the presenting TTY. For this reason, docker provides an API -call to resize the allocated PTY. A SIGWINCH handler is used to detect window -size changes and resize the pseudo-terminal as needed. - -## Contributors - - - Primary author: [Chris Corbyn](https://github.com/d11wtq) - - Collaborator: [Daniel Nephin](https://github.com/dnephin) - - Contributor: [Stephen Moore](https://github.com/delfick) - - Contributor: [Ben Firshman](https://github.com/bfirsh) - -## Copyright & Licensing - -Copyright © 2014 Chris Corbyn. See the LICENSE.txt file for details. - - http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/6a81d1e7/env2/lib/python2.7/site-packages/dockerpty-0.4.1.dist-info/RECORD ---------------------------------------------------------------------- diff --git a/env2/lib/python2.7/site-packages/dockerpty-0.4.1.dist-info/RECORD b/env2/lib/python2.7/site-packages/dockerpty-0.4.1.dist-info/RECORD deleted file mode 100644 index 014a9b1..0000000 --- a/env2/lib/python2.7/site-packages/dockerpty-0.4.1.dist-info/RECORD +++ /dev/null @@ -1,15 +0,0 @@ -dockerpty/__init__.py,sha256=IXpe8RsuCmVr41ImQmG5NZ1kcyY6cuOCWG7-CXM5bEo,1979 -dockerpty/io.py,sha256=h27li_ZSv0d0Hcu0LIl9diA6qLb4dgBBaFDlNhlnKeU,11042 -dockerpty/pty.py,sha256=g6ghhwkkxmEnnnwQJRbvfLuzLIkIf-zjHLk0v72YU6Q,11219 -dockerpty/tty.py,sha256=WDgOq0idyVWanPlNhWBJZcizLfz80N2TzEUlTieHajY,3200 -dockerpty-0.4.1.dist-info/DESCRIPTION.rst,sha256=CKRz6il_1XJdRH-JDoQssGbt6C2ZBFZXcpGO1Y66fOs,4442 -dockerpty-0.4.1.dist-info/METADATA,sha256=ErIahjB5m75PlFOpjgQrntNUmy63pfPdc-uF3cmA8qY,5219 -dockerpty-0.4.1.dist-info/RECORD,, -dockerpty-0.4.1.dist-info/WHEEL,sha256=BtVfdXUcEYLcFjOkbIrCFRyXU4qszVPt-E9o3RWkSNw,93 -dockerpty-0.4.1.dist-info/metadata.json,sha256=hCeBa8__a2nWuEXPHb5thZWeGSxRW0V8nFnrp_zussU,951 -dockerpty-0.4.1.dist-info/top_level.txt,sha256=0oFwVL_RFLty0HIyv-4bbvwHlBCLGnMj66Y7zsVQJog,10 -dockerpty-0.4.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 -dockerpty/__init__.pyc,, -dockerpty/io.pyc,, -dockerpty/tty.pyc,, -dockerpty/pty.pyc,, http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/6a81d1e7/env2/lib/python2.7/site-packages/dockerpty-0.4.1.dist-info/WHEEL ---------------------------------------------------------------------- diff --git a/env2/lib/python2.7/site-packages/dockerpty-0.4.1.dist-info/WHEEL b/env2/lib/python2.7/site-packages/dockerpty-0.4.1.dist-info/WHEEL deleted file mode 100644 index 5a93381..0000000 --- a/env2/lib/python2.7/site-packages/dockerpty-0.4.1.dist-info/WHEEL +++ /dev/null @@ -1,5 +0,0 @@ -Wheel-Version: 1.0 -Generator: bdist_wheel (0.29.0) -Root-Is-Purelib: true -Tag: cp27-none-any - http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/6a81d1e7/env2/lib/python2.7/site-packages/dockerpty-0.4.1.dist-info/metadata.json ---------------------------------------------------------------------- diff --git a/env2/lib/python2.7/site-packages/dockerpty-0.4.1.dist-info/metadata.json b/env2/lib/python2.7/site-packages/dockerpty-0.4.1.dist-info/metadata.json deleted file mode 100644 index 8e1fd5f..0000000 --- a/env2/lib/python2.7/site-packages/dockerpty-0.4.1.dist-info/metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"classifiers": ["Development Status :: 4 - Beta", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Environment :: Console", "Intended Audience :: Developers", "Topic :: Terminals", "Topic :: Terminals :: Terminal Emulators/X Terminals", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules"], "extensions": {"python.details": {"contacts": [{"email": "ch...@w3style.co.uk", "name": "Chris Corbyn", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "https://github.com/d11wtq/dockerpty"}}}, "extras": [], "generator": "bdist_wheel (0.29.0)", "keywords": ["docker", "tty", "pty", "terminal"], "license": "Apache 2.0", "metadata_version": "2.0", "name": "dockerpty", "run_requires": [{"requires": ["six (>=1.3.0)"]}], "summary": "Python library to use the pseudo-tty of a docker container", "version": "0.4.1"} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/6a81d1e7/env2/lib/python2.7/site-packages/dockerpty-0.4.1.dist-info/top_level.txt ---------------------------------------------------------------------- diff --git a/env2/lib/python2.7/site-packages/dockerpty-0.4.1.dist-info/top_level.txt b/env2/lib/python2.7/site-packages/dockerpty-0.4.1.dist-info/top_level.txt deleted file mode 100644 index ba4766d..0000000 --- a/env2/lib/python2.7/site-packages/dockerpty-0.4.1.dist-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -dockerpty http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/6a81d1e7/env2/lib/python2.7/site-packages/dockerpty/__init__.py ---------------------------------------------------------------------- diff --git a/env2/lib/python2.7/site-packages/dockerpty/__init__.py b/env2/lib/python2.7/site-packages/dockerpty/__init__.py deleted file mode 100644 index 1dba089..0000000 --- a/env2/lib/python2.7/site-packages/dockerpty/__init__.py +++ /dev/null @@ -1,50 +0,0 @@ -# dockerpty. -# -# Copyright 2014 Chris Corbyn <ch...@w3style.co.uk> -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from dockerpty.pty import PseudoTerminal, RunOperation, ExecOperation, exec_create - - -def start(client, container, interactive=True, stdout=None, stderr=None, stdin=None, logs=None): - """ - Present the PTY of the container inside the current process. - - This is just a wrapper for PseudoTerminal(client, container).start() - """ - - operation = RunOperation(client, container, interactive=interactive, stdout=stdout, - stderr=stderr, stdin=stdin, logs=logs) - - PseudoTerminal(client, operation).start() - - -def exec_command( - client, container, command, interactive=True, stdout=None, stderr=None, stdin=None): - """ - Run provided command via exec API in provided container. - - This is just a wrapper for PseudoTerminal(client, container).exec_command() - """ - exec_id = exec_create(client, container, command, interactive=interactive) - - operation = ExecOperation(client, exec_id, - interactive=interactive, stdout=stdout, stderr=stderr, stdin=stdin) - PseudoTerminal(client, operation).start() - - -def start_exec(client, exec_id, interactive=True, stdout=None, stderr=None, stdin=None): - operation = ExecOperation(client, exec_id, - interactive=interactive, stdout=stdout, stderr=stderr, stdin=stdin) - PseudoTerminal(client, operation).start() http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/6a81d1e7/env2/lib/python2.7/site-packages/dockerpty/io.py ---------------------------------------------------------------------- diff --git a/env2/lib/python2.7/site-packages/dockerpty/io.py b/env2/lib/python2.7/site-packages/dockerpty/io.py deleted file mode 100644 index f4e8ced..0000000 --- a/env2/lib/python2.7/site-packages/dockerpty/io.py +++ /dev/null @@ -1,394 +0,0 @@ -# dockerpty: io.py -# -# Copyright 2014 Chris Corbyn <ch...@w3style.co.uk> -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import fcntl -import errno -import struct -import select as builtin_select -import six - - -def set_blocking(fd, blocking=True): - """ - Set the given file-descriptor blocking or non-blocking. - - Returns the original blocking status. - """ - - old_flag = fcntl.fcntl(fd, fcntl.F_GETFL) - - if blocking: - new_flag = old_flag & ~ os.O_NONBLOCK - else: - new_flag = old_flag | os.O_NONBLOCK - - fcntl.fcntl(fd, fcntl.F_SETFL, new_flag) - - return not bool(old_flag & os.O_NONBLOCK) - - -def select(read_streams, write_streams, timeout=0): - """ - Select the streams from `read_streams` that are ready for reading, and - streams from `write_streams` ready for writing. - - Uses `select.select()` internally but only returns two lists of ready streams. - """ - - exception_streams = [] - - try: - return builtin_select.select( - read_streams, - write_streams, - exception_streams, - timeout, - )[0:2] - except builtin_select.error as e: - # POSIX signals interrupt select() - no = e.errno if six.PY3 else e[0] - if no == errno.EINTR: - return ([], []) - else: - raise e - - -class Stream(object): - """ - Generic Stream class. - - This is a file-like abstraction on top of os.read() and os.write(), which - add consistency to the reading of sockets and files alike. - """ - - """ - Recoverable IO/OS Errors. - """ - ERRNO_RECOVERABLE = [ - errno.EINTR, - errno.EDEADLK, - errno.EWOULDBLOCK, - ] - - def __init__(self, fd): - """ - Initialize the Stream for the file descriptor `fd`. - - The `fd` object must have a `fileno()` method. - """ - self.fd = fd - self.buffer = b'' - self.close_requested = False - self.closed = False - - def fileno(self): - """ - Return the fileno() of the file descriptor. - """ - - return self.fd.fileno() - - def set_blocking(self, value): - if hasattr(self.fd, 'setblocking'): - self.fd.setblocking(value) - return True - else: - return set_blocking(self.fd, value) - - def read(self, n=4096): - """ - Return `n` bytes of data from the Stream, or None at end of stream. - """ - - while True: - try: - if hasattr(self.fd, 'recv'): - return self.fd.recv(n) - return os.read(self.fd.fileno(), n) - except EnvironmentError as e: - if e.errno not in Stream.ERRNO_RECOVERABLE: - raise e - - - def write(self, data): - """ - Write `data` to the Stream. Not all data may be written right away. - Use select to find when the stream is writeable, and call do_write() - to flush the internal buffer. - """ - - if not data: - return None - - self.buffer += data - self.do_write() - - return len(data) - - def do_write(self): - """ - Flushes as much pending data from the internal write buffer as possible. - """ - while True: - try: - written = 0 - - if hasattr(self.fd, 'send'): - written = self.fd.send(self.buffer) - else: - written = os.write(self.fd.fileno(), self.buffer) - - self.buffer = self.buffer[written:] - - # try to close after writes if a close was requested - if self.close_requested and len(self.buffer) == 0: - self.close() - - return written - except EnvironmentError as e: - if e.errno not in Stream.ERRNO_RECOVERABLE: - raise e - - def needs_write(self): - """ - Returns True if the stream has data waiting to be written. - """ - return len(self.buffer) > 0 - - def close(self): - self.close_requested = True - - # We don't close the fd immediately, as there may still be data pending - # to write. - if not self.closed and len(self.buffer) == 0: - self.closed = True - if hasattr(self.fd, 'close'): - self.fd.close() - else: - os.close(self.fd.fileno()) - - def __repr__(self): - return "{cls}({fd})".format(cls=type(self).__name__, fd=self.fd) - - -class Demuxer(object): - """ - Wraps a multiplexed Stream to read in data demultiplexed. - - Docker multiplexes streams together when there is no PTY attached, by - sending an 8-byte header, followed by a chunk of data. - - The first 4 bytes of the header denote the stream from which the data came - (i.e. 0x01 = stdout, 0x02 = stderr). Only the first byte of these initial 4 - bytes is used. - - The next 4 bytes indicate the length of the following chunk of data as an - integer in big endian format. This much data must be consumed before the - next 8-byte header is read. - """ - - def __init__(self, stream): - """ - Initialize a new Demuxer reading from `stream`. - """ - - self.stream = stream - self.remain = 0 - - def fileno(self): - """ - Returns the fileno() of the underlying Stream. - - This is useful for select() to work. - """ - - return self.stream.fileno() - - def set_blocking(self, value): - return self.stream.set_blocking(value) - - def read(self, n=4096): - """ - Read up to `n` bytes of data from the Stream, after demuxing. - - Less than `n` bytes of data may be returned depending on the available - payload, but the number of bytes returned will never exceed `n`. - - Because demuxing involves scanning 8-byte headers, the actual amount of - data read from the underlying stream may be greater than `n`. - """ - - size = self._next_packet_size(n) - - if size <= 0: - return - else: - data = six.binary_type() - while len(data) < size: - nxt = self.stream.read(size - len(data)) - if not nxt: - # the stream has closed, return what data we got - return data - data = data + nxt - return data - - def write(self, data): - """ - Delegates the the underlying Stream. - """ - - return self.stream.write(data) - - def needs_write(self): - """ - Delegates to underlying Stream. - """ - - if hasattr(self.stream, 'needs_write'): - return self.stream.needs_write() - - return False - - def do_write(self): - """ - Delegates to underlying Stream. - """ - - if hasattr(self.stream, 'do_write'): - return self.stream.do_write() - - return False - - def close(self): - """ - Delegates to underlying Stream. - """ - - return self.stream.close() - - def _next_packet_size(self, n=0): - size = 0 - - if self.remain > 0: - size = min(n, self.remain) - self.remain -= size - else: - data = six.binary_type() - while len(data) < 8: - nxt = self.stream.read(8 - len(data)) - if not nxt: - # The stream has closed, there's nothing more to read - return 0 - data = data + nxt - - if data is None: - return 0 - if len(data) == 8: - __, actual = struct.unpack('>BxxxL', data) - size = min(n, actual) - self.remain = actual - size - - return size - - def __repr__(self): - return "{cls}({stream})".format(cls=type(self).__name__, - stream=self.stream) - - -class Pump(object): - """ - Stream pump class. - - A Pump wraps two Streams, reading from one and and writing its data into - the other, much like a pipe but manually managed. - - This abstraction is used to facilitate piping data between the file - descriptors associated with the tty and those associated with a container's - allocated pty. - - Pumps are selectable based on the 'read' end of the pipe. - """ - - def __init__(self, - from_stream, - to_stream, - wait_for_output=True, - propagate_close=True): - """ - Initialize a Pump with a Stream to read from and another to write to. - - `wait_for_output` is a flag that says that we need to wait for EOF - on the from_stream in order to consider this pump as "done". - """ - - self.from_stream = from_stream - self.to_stream = to_stream - self.eof = False - self.wait_for_output = wait_for_output - self.propagate_close = propagate_close - - def fileno(self): - """ - Returns the `fileno()` of the reader end of the Pump. - - This is useful to allow Pumps to function with `select()`. - """ - - return self.from_stream.fileno() - - def set_blocking(self, value): - return self.from_stream.set_blocking(value) - - def flush(self, n=4096): - """ - Flush `n` bytes of data from the reader Stream to the writer Stream. - - Returns the number of bytes that were actually flushed. A return value - of zero is not an error. - - If EOF has been reached, `None` is returned. - """ - - try: - read = self.from_stream.read(n) - - if read is None or len(read) == 0: - self.eof = True - if self.propagate_close: - self.to_stream.close() - return None - - return self.to_stream.write(read) - except OSError as e: - if e.errno != errno.EPIPE: - raise e - - def is_done(self): - """ - Returns True if the read stream is done (either it's returned EOF or - the pump doesn't have wait_for_output set), and the write - side does not have pending bytes to send. - """ - - return (not self.wait_for_output or self.eof) and \ - not (hasattr(self.to_stream, 'needs_write') and self.to_stream.needs_write()) - - def __repr__(self): - return "{cls}(from={from_stream}, to={to_stream})".format( - cls=type(self).__name__, - from_stream=self.from_stream, - to_stream=self.to_stream) http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/6a81d1e7/env2/lib/python2.7/site-packages/dockerpty/pty.py ---------------------------------------------------------------------- diff --git a/env2/lib/python2.7/site-packages/dockerpty/pty.py b/env2/lib/python2.7/site-packages/dockerpty/pty.py deleted file mode 100644 index 25cb788..0000000 --- a/env2/lib/python2.7/site-packages/dockerpty/pty.py +++ /dev/null @@ -1,380 +0,0 @@ -# dockerpty: pty.py -# -# Copyright 2014 Chris Corbyn <ch...@w3style.co.uk> -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import sys -import signal -import warnings -from ssl import SSLError - -import dockerpty.io as io -import dockerpty.tty as tty - - -class WINCHHandler(object): - """ - WINCH Signal handler to keep the PTY correctly sized. - """ - - def __init__(self, pty): - """ - Initialize a new WINCH handler for the given PTY. - - Initializing a handler has no immediate side-effects. The `start()` - method must be invoked for the signals to be trapped. - """ - - self.pty = pty - self.original_handler = None - - def __enter__(self): - """ - Invoked on entering a `with` block. - """ - - self.start() - return self - - def __exit__(self, *_): - """ - Invoked on exiting a `with` block. - """ - - self.stop() - - def start(self): - """ - Start trapping WINCH signals and resizing the PTY. - - This method saves the previous WINCH handler so it can be restored on - `stop()`. - """ - - def handle(signum, frame): - if signum == signal.SIGWINCH: - self.pty.resize() - - self.original_handler = signal.signal(signal.SIGWINCH, handle) - - def stop(self): - """ - Stop trapping WINCH signals and restore the previous WINCH handler. - """ - - if self.original_handler is not None: - signal.signal(signal.SIGWINCH, self.original_handler) - - -class Operation(object): - - def israw(self, **kwargs): - """ - are we dealing with a tty or not? - """ - raise NotImplementedError() - - def start(self, **kwargs): - """ - start execution - """ - raise NotImplementedError() - - def resize(self, height, width, **kwargs): - """ - if we have terminal, resize it - """ - raise NotImplementedError() - - def sockets(self): - """Return sockets for streams.""" - raise NotImplementedError() - - -class RunOperation(Operation): - """ - class for handling `docker run`-like command - """ - - def __init__(self, client, container, interactive=True, stdout=None, stderr=None, stdin=None, logs=None): - """ - Initialize the PTY using the docker.Client instance and container dict. - """ - - if logs is None: - warnings.warn("The default behaviour of dockerpty is changing. Please add logs=1 to your dockerpty.start call to maintain existing behaviour. See https://github.com/d11wtq/dockerpty/issues/51 for details.", DeprecationWarning) - logs = 1 - - self.client = client - self.container = container - self.raw = None - self.interactive = interactive - self.stdout = stdout or sys.stdout - self.stderr = stderr or sys.stderr - self.stdin = stdin or sys.stdin - self.logs = logs - - def start(self, sockets=None, **kwargs): - """ - Present the PTY of the container inside the current process. - - This will take over the current process' TTY until the container's PTY - is closed. - """ - - pty_stdin, pty_stdout, pty_stderr = sockets or self.sockets() - pumps = [] - - if pty_stdin and self.interactive: - pumps.append(io.Pump(io.Stream(self.stdin), pty_stdin, wait_for_output=False)) - - if pty_stdout: - pumps.append(io.Pump(pty_stdout, io.Stream(self.stdout), propagate_close=False)) - - if pty_stderr: - pumps.append(io.Pump(pty_stderr, io.Stream(self.stderr), propagate_close=False)) - - if not self._container_info()['State']['Running']: - self.client.start(self.container, **kwargs) - - return pumps - - def israw(self, **kwargs): - """ - Returns True if the PTY should operate in raw mode. - - If the container was not started with tty=True, this will return False. - """ - - if self.raw is None: - info = self._container_info() - self.raw = self.stdout.isatty() and info['Config']['Tty'] - - return self.raw - - def sockets(self): - """ - Returns a tuple of sockets connected to the pty (stdin,stdout,stderr). - - If any of the sockets are not attached in the container, `None` is - returned in the tuple. - """ - - info = self._container_info() - - def attach_socket(key): - if info['Config']['Attach{0}'.format(key.capitalize())]: - socket = self.client.attach_socket( - self.container, - {key: 1, 'stream': 1, 'logs': self.logs}, - ) - stream = io.Stream(socket) - - if info['Config']['Tty']: - return stream - else: - return io.Demuxer(stream) - else: - return None - - return map(attach_socket, ('stdin', 'stdout', 'stderr')) - - def resize(self, height, width, **kwargs): - """ - resize pty within container - """ - self.client.resize(self.container, height=height, width=width) - - def _container_info(self): - """ - Thin wrapper around client.inspect_container(). - """ - - return self.client.inspect_container(self.container) - - -def exec_create(client, container, command, interactive=True): - exec_id = client.exec_create(container, command, tty=interactive, stdin=interactive) - return exec_id - - -class ExecOperation(Operation): - """ - class for handling `docker exec`-like command - """ - - def __init__(self, client, exec_id, interactive=True, stdout=None, stderr=None, stdin=None): - self.exec_id = exec_id - self.client = client - self.raw = None - self.interactive = interactive - self.stdout = stdout or sys.stdout - self.stderr = stderr or sys.stderr - self.stdin = stdin or sys.stdin - self._info = None - - def start(self, sockets=None, **kwargs): - """ - start execution - """ - stream = sockets or self.sockets() - pumps = [] - - if self.interactive: - pumps.append(io.Pump(io.Stream(self.stdin), stream, wait_for_output=False)) - - pumps.append(io.Pump(stream, io.Stream(self.stdout), propagate_close=False)) - # FIXME: since exec_start returns a single socket, how do we - # distinguish between stdout and stderr? - # pumps.append(io.Pump(stream, io.Stream(self.stderr), propagate_close=False)) - - return pumps - - def israw(self, **kwargs): - """ - Returns True if the PTY should operate in raw mode. - - If the exec was not started with tty=True, this will return False. - """ - - if self.raw is None: - self.raw = self.stdout.isatty() and self.is_process_tty() - - return self.raw - - def sockets(self): - """ - Return a single socket which is processing all I/O to exec - """ - socket = self.client.exec_start(self.exec_id, socket=True, tty=self.interactive) - stream = io.Stream(socket) - if self.is_process_tty(): - return stream - else: - return io.Demuxer(stream) - - def resize(self, height, width, **kwargs): - """ - resize pty of an execed process - """ - self.client.exec_resize(self.exec_id, height=height, width=width) - - def is_process_tty(self): - """ - does execed process have allocated tty? - """ - return self._exec_info()["ProcessConfig"]["tty"] - - def _exec_info(self): - """ - Caching wrapper around client.exec_inspect - """ - if self._info is None: - self._info = self.client.exec_inspect(self.exec_id) - return self._info - - -class PseudoTerminal(object): - """ - Wraps the pseudo-TTY (PTY) allocated to a docker container. - - The PTY is managed via the current process' TTY until it is closed. - - Example: - - import docker - from dockerpty import PseudoTerminal - - client = docker.Client() - container = client.create_container( - image='busybox:latest', - stdin_open=True, - tty=True, - command='/bin/sh', - ) - - # hijacks the current tty until the pty is closed - PseudoTerminal(client, container).start() - - Care is taken to ensure all file descriptors are restored on exit. For - example, you can attach to a running container from within a Python REPL - and when the container exits, the user will be returned to the Python REPL - without adverse effects. - """ - - def __init__(self, client, operation): - """ - Initialize the PTY using the docker.Client instance and container dict. - """ - - self.client = client - self.operation = operation - - def sockets(self): - return self.operation.sockets() - - def start(self, sockets=None): - pumps = self.operation.start(sockets=sockets) - - flags = [p.set_blocking(False) for p in pumps] - - try: - with WINCHHandler(self): - self._hijack_tty(pumps) - finally: - if flags: - for (pump, flag) in zip(pumps, flags): - io.set_blocking(pump, flag) - - def resize(self, size=None): - """ - Resize the container's PTY. - - If `size` is not None, it must be a tuple of (height,width), otherwise - it will be determined by the size of the current TTY. - """ - - if not self.operation.israw(): - return - - size = size or tty.size(self.operation.stdout) - - if size is not None: - rows, cols = size - try: - self.operation.resize(height=rows, width=cols) - except IOError: # Container already exited - pass - - def _hijack_tty(self, pumps): - with tty.Terminal(self.operation.stdin, raw=self.operation.israw()): - self.resize() - while True: - read_pumps = [p for p in pumps if not p.eof] - write_streams = [p.to_stream for p in pumps if p.to_stream.needs_write()] - - read_ready, write_ready = io.select(read_pumps, write_streams, timeout=60) - try: - for write_stream in write_ready: - write_stream.do_write() - - for pump in read_ready: - pump.flush() - - if all([p.is_done() for p in pumps]): - break - - except SSLError as e: - if 'The operation did not complete' not in e.strerror: - raise e http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/6a81d1e7/env2/lib/python2.7/site-packages/dockerpty/tty.py ---------------------------------------------------------------------- diff --git a/env2/lib/python2.7/site-packages/dockerpty/tty.py b/env2/lib/python2.7/site-packages/dockerpty/tty.py deleted file mode 100644 index bd2ccb5..0000000 --- a/env2/lib/python2.7/site-packages/dockerpty/tty.py +++ /dev/null @@ -1,130 +0,0 @@ -# dockerpty: tty.py -# -# Copyright 2014 Chris Corbyn <ch...@w3style.co.uk> -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from __future__ import absolute_import - -import os -import termios -import tty -import fcntl -import struct - - -def size(fd): - """ - Return a tuple (rows,cols) representing the size of the TTY `fd`. - - The provided file descriptor should be the stdout stream of the TTY. - - If the TTY size cannot be determined, returns None. - """ - - if not os.isatty(fd.fileno()): - return None - - try: - dims = struct.unpack('hh', fcntl.ioctl(fd, termios.TIOCGWINSZ, 'hhhh')) - except: - try: - dims = (os.environ['LINES'], os.environ['COLUMNS']) - except: - return None - - return dims - - -class Terminal(object): - """ - Terminal provides wrapper functionality to temporarily make the tty raw. - - This is useful when streaming data from a pseudo-terminal into the tty. - - Example: - - with Terminal(sys.stdin, raw=True): - do_things_in_raw_mode() - """ - - def __init__(self, fd, raw=True): - """ - Initialize a terminal for the tty with stdin attached to `fd`. - - Initializing the Terminal has no immediate side effects. The `start()` - method must be invoked, or `with raw_terminal:` used before the - terminal is affected. - """ - - self.fd = fd - self.raw = raw - self.original_attributes = None - - - def __enter__(self): - """ - Invoked when a `with` block is first entered. - """ - - self.start() - return self - - - def __exit__(self, *_): - """ - Invoked when a `with` block is finished. - """ - - self.stop() - - - def israw(self): - """ - Returns True if the TTY should operate in raw mode. - """ - - return self.raw - - - def start(self): - """ - Saves the current terminal attributes and makes the tty raw. - - This method returns None immediately. - """ - - if os.isatty(self.fd.fileno()) and self.israw(): - self.original_attributes = termios.tcgetattr(self.fd) - tty.setraw(self.fd) - - - def stop(self): - """ - Restores the terminal attributes back to before setting raw mode. - - If the raw terminal was not started, does nothing. - """ - - if self.original_attributes is not None: - termios.tcsetattr( - self.fd, - termios.TCSADRAIN, - self.original_attributes, - ) - - def __repr__(self): - return "{cls}({fd}, raw={raw})".format( - cls=type(self).__name__, - fd=self.fd, - raw=self.raw) http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/6a81d1e7/env2/lib/python2.7/site-packages/dockerpycreds/__init__.py ---------------------------------------------------------------------- diff --git a/env2/lib/python2.7/site-packages/dockerpycreds/__init__.py b/env2/lib/python2.7/site-packages/dockerpycreds/__init__.py deleted file mode 100644 index c6ef0e6..0000000 --- a/env2/lib/python2.7/site-packages/dockerpycreds/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# flake8: noqa -from .store import Store -from .errors import StoreError, CredentialsNotFound -from .constants import * \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/6a81d1e7/env2/lib/python2.7/site-packages/dockerpycreds/constants.py ---------------------------------------------------------------------- diff --git a/env2/lib/python2.7/site-packages/dockerpycreds/constants.py b/env2/lib/python2.7/site-packages/dockerpycreds/constants.py deleted file mode 100644 index c6492fe..0000000 --- a/env2/lib/python2.7/site-packages/dockerpycreds/constants.py +++ /dev/null @@ -1,3 +0,0 @@ -PROGRAM_PREFIX = 'docker-credential-' -DEFAULT_LINUX_STORE = 'secretservice' -DEFAULT_OSX_STORE = 'osxkeychain' http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/6a81d1e7/env2/lib/python2.7/site-packages/dockerpycreds/errors.py ---------------------------------------------------------------------- diff --git a/env2/lib/python2.7/site-packages/dockerpycreds/errors.py b/env2/lib/python2.7/site-packages/dockerpycreds/errors.py deleted file mode 100644 index 3bd53a2..0000000 --- a/env2/lib/python2.7/site-packages/dockerpycreds/errors.py +++ /dev/null @@ -1,21 +0,0 @@ -class StoreError(RuntimeError): - pass - - -class CredentialsNotFound(StoreError): - pass - - -def process_store_error(cpe, program): - message = cpe.output.decode('utf-8') - if 'credentials not found in native keychain' in message: - return CredentialsNotFound( - 'No matching credentials in {0}'.format( - program - ) - ) - return StoreError( - 'Credentials store {0} exited with "{1}".'.format( - program, cpe.output.decode('utf-8').strip() - ) - ) http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/6a81d1e7/env2/lib/python2.7/site-packages/dockerpycreds/store.py ---------------------------------------------------------------------- diff --git a/env2/lib/python2.7/site-packages/dockerpycreds/store.py b/env2/lib/python2.7/site-packages/dockerpycreds/store.py deleted file mode 100644 index 2d9e290..0000000 --- a/env2/lib/python2.7/site-packages/dockerpycreds/store.py +++ /dev/null @@ -1,79 +0,0 @@ -import json -import os -import subprocess - -import six - -from . import constants -from . import errors - - -class Store(object): - def __init__(self, program): - """ Create a store object that acts as an interface to - perform the basic operations for storing, retrieving - and erasing credentials using `program`. - """ - self.program = constants.PROGRAM_PREFIX + program - - def get(self, server): - """ Retrieve credentials for `server`. If no credentials are found, - a `StoreError` will be raised. - """ - if not isinstance(server, six.binary_type): - server = server.encode('utf-8') - data = self._execute('get', server) - return json.loads(data.decode('utf-8')) - - def store(self, server, username, secret): - """ Store credentials for `server`. Raises a `StoreError` if an error - occurs. - """ - data_input = json.dumps({ - 'ServerURL': server, - 'Username': username, - 'Secret': secret - }).encode('utf-8') - return self._execute('store', data_input) - - def erase(self, server): - """ Erase credentials for `server`. Raises a `StoreError` if an error - occurs. - """ - if not isinstance(server, six.binary_type): - server = server.encode('utf-8') - self._execute('erase', server) - - def _execute(self, subcmd, data_input): - output = None - try: - if six.PY3: - output = subprocess.check_output( - [self.program, subcmd], input=data_input - ) - else: - process = subprocess.Popen( - [self.program, subcmd], stdin=subprocess.PIPE, - stdout=subprocess.PIPE - ) - output, err = process.communicate(data_input) - if process.returncode != 0: - raise subprocess.CalledProcessError( - returncode=process.returncode, cmd='', output=output - ) - except subprocess.CalledProcessError as e: - raise errors.process_store_error(e, self.program) - except OSError as e: - if e.errno == os.errno.ENOENT: - raise errors.StoreError( - '{0} not installed or not available in PATH'.format( - self.program - ) - ) - else: - raise errors.StoreError( - 'Unexpected OS error "{0}", errno={1}'.format( - e.strerror, e.errno - ) - ) - return output http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/6a81d1e7/env2/lib/python2.7/site-packages/dockerpycreds/version.py ---------------------------------------------------------------------- diff --git a/env2/lib/python2.7/site-packages/dockerpycreds/version.py b/env2/lib/python2.7/site-packages/dockerpycreds/version.py deleted file mode 100644 index 4c43916..0000000 --- a/env2/lib/python2.7/site-packages/dockerpycreds/version.py +++ /dev/null @@ -1,2 +0,0 @@ -version = "0.2.1" -version_info = tuple([int(d) for d in version.split("-")[0].split(".")]) http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/6a81d1e7/env2/lib/python2.7/site-packages/docopt-0.6.2.dist-info/DESCRIPTION.rst ---------------------------------------------------------------------- diff --git a/env2/lib/python2.7/site-packages/docopt-0.6.2.dist-info/DESCRIPTION.rst b/env2/lib/python2.7/site-packages/docopt-0.6.2.dist-info/DESCRIPTION.rst deleted file mode 100644 index 118f1c9..0000000 --- a/env2/lib/python2.7/site-packages/docopt-0.6.2.dist-info/DESCRIPTION.rst +++ /dev/null @@ -1,450 +0,0 @@ -``docopt`` creates *beautiful* command-line interfaces -====================================================================== - -Video introduction to **docopt**: `PyCon UK 2012: Create *beautiful* -command-line interfaces with Python <http://youtu.be/pXhcPJK5cMc>`_ - - New in version 0.6.1: - - - Fix issue `#85 <https://github.com/docopt/docopt/issues/85>`_ - which caused improper handling of ``[options]`` shortcut - if it was present several times. - - New in version 0.6.0: - - - New argument ``options_first``, disallows interspersing options - and arguments. If you supply ``options_first=True`` to - ``docopt``, it will interpret all arguments as positional - arguments after first positional argument. - - - If option with argument could be repeated, its default value - will be interpreted as space-separated list. E.g. with - ``[default: ./here ./there]`` will be interpreted as - ``['./here', './there']``. - - Breaking changes: - - - Meaning of ``[options]`` shortcut slightly changed. Previously - it ment *"any known option"*. Now it means *"any option not in - usage-pattern"*. This avoids the situation when an option is - allowed to be repeated unintentionaly. - - - ``argv`` is ``None`` by default, not ``sys.argv[1:]``. - This allows ``docopt`` to always use the *latest* ``sys.argv``, - not ``sys.argv`` during import time. - -Isn't it awesome how ``optparse`` and ``argparse`` generate help -messages based on your code?! - -*Hell no!* You know what's awesome? It's when the option parser *is* -generated based on the beautiful help message that you write yourself! -This way you don't need to write this stupid repeatable parser-code, -and instead can write only the help message--*the way you want it*. - -**docopt** helps you create most beautiful command-line interfaces -*easily*: - -.. code:: python - - """Naval Fate. - - Usage: - naval_fate.py ship new <name>... - naval_fate.py ship <name> move <x> <y> [--speed=<kn>] - naval_fate.py ship shoot <x> <y> - naval_fate.py mine (set|remove) <x> <y> [--moored | --drifting] - naval_fate.py (-h | --help) - naval_fate.py --version - - Options: - -h --help Show this screen. - --version Show version. - --speed=<kn> Speed in knots [default: 10]. - --moored Moored (anchored) mine. - --drifting Drifting mine. - - """ - from docopt import docopt - - - if __name__ == '__main__': - arguments = docopt(__doc__, version='Naval Fate 2.0') - print(arguments) - -Beat that! The option parser is generated based on the docstring above -that is passed to ``docopt`` function. ``docopt`` parses the usage -pattern (``"Usage: ..."``) and option descriptions (lines starting -with dash "``-``") and ensures that the program invocation matches the -usage pattern; it parses options, arguments and commands based on -that. The basic idea is that *a good help message has all necessary -information in it to make a parser*. - -Also, `PEP 257 <http://www.python.org/dev/peps/pep-0257/>`_ recommends -putting help message in the module docstrings. - -Installation -====================================================================== - -Use `pip <http://pip-installer.org>`_ or easy_install:: - - pip install docopt==0.6.2 - -Alternatively, you can just drop ``docopt.py`` file into your -project--it is self-contained. - -**docopt** is tested with Python 2.5, 2.6, 2.7, 3.2, 3.3 and PyPy. - -API -====================================================================== - -.. code:: python - - from docopt import docopt - -.. code:: python - - docopt(doc, argv=None, help=True, version=None, options_first=False) - -``docopt`` takes 1 required and 4 optional arguments: - -- ``doc`` could be a module docstring (``__doc__``) or some other - string that contains a **help message** that will be parsed to - create the option parser. The simple rules of how to write such a - help message are given in next sections. Here is a quick example of - such a string: - -.. code:: python - - """Usage: my_program.py [-hso FILE] [--quiet | --verbose] [INPUT ...] - - -h --help show this - -s --sorted sorted output - -o FILE specify output file [default: ./test.txt] - --quiet print less text - --verbose print more text - - """ - -- ``argv`` is an optional argument vector; by default ``docopt`` uses - the argument vector passed to your program (``sys.argv[1:]``). - Alternatively you can supply a list of strings like ``['--verbose', - '-o', 'hai.txt']``. - -- ``help``, by default ``True``, specifies whether the parser should - automatically print the help message (supplied as ``doc``) and - terminate, in case ``-h`` or ``--help`` option is encountered - (options should exist in usage pattern, more on that below). If you - want to handle ``-h`` or ``--help`` options manually (as other - options), set ``help=False``. - -- ``version``, by default ``None``, is an optional argument that - specifies the version of your program. If supplied, then, (assuming - ``--version`` option is mentioned in usage pattern) when parser - encounters the ``--version`` option, it will print the supplied - version and terminate. ``version`` could be any printable object, - but most likely a string, e.g. ``"2.1.0rc1"``. - - Note, when ``docopt`` is set to automatically handle ``-h``, - ``--help`` and ``--version`` options, you still need to mention - them in usage pattern for this to work. Also, for your users to - know about them. - -- ``options_first``, by default ``False``. If set to ``True`` will - disallow mixing options and positional argument. I.e. after first - positional argument, all arguments will be interpreted as positional - even if the look like options. This can be used for strict - compatibility with POSIX, or if you want to dispatch your arguments - to other programs. - -The **return** value is a simple dictionary with options, arguments -and commands as keys, spelled exactly like in your help message. Long -versions of options are given priority. For example, if you invoke the -top example as:: - - naval_fate.py ship Guardian move 100 150 --speed=15 - -the return dictionary will be: - -.. code:: python - - {'--drifting': False, 'mine': False, - '--help': False, 'move': True, - '--moored': False, 'new': False, - '--speed': '15', 'remove': False, - '--version': False, 'set': False, - '<name>': ['Guardian'], 'ship': True, - '<x>': '100', 'shoot': False, - '<y>': '150'} - -Help message format -====================================================================== - -Help message consists of 2 parts: - -- Usage pattern, e.g.:: - - Usage: my_program.py [-hso FILE] [--quiet | --verbose] [INPUT ...] - -- Option descriptions, e.g.:: - - -h --help show this - -s --sorted sorted output - -o FILE specify output file [default: ./test.txt] - --quiet print less text - --verbose print more text - -Their format is described below; other text is ignored. - -Usage pattern format ----------------------------------------------------------------------- - -**Usage pattern** is a substring of ``doc`` that starts with -``usage:`` (case *insensitive*) and ends with a *visibly* empty line. -Minimum example: - -.. code:: python - - """Usage: my_program.py - - """ - -The first word after ``usage:`` is interpreted as your program's name. -You can specify your program's name several times to signify several -exclusive patterns: - -.. code:: python - - """Usage: my_program.py FILE - my_program.py COUNT FILE - - """ - -Each pattern can consist of the following elements: - -- **<arguments>**, **ARGUMENTS**. Arguments are specified as either - upper-case words, e.g. ``my_program.py CONTENT-PATH`` or words - surrounded by angular brackets: ``my_program.py <content-path>``. -- **--options**. Options are words started with dash (``-``), e.g. - ``--output``, ``-o``. You can "stack" several of one-letter - options, e.g. ``-oiv`` which will be the same as ``-o -i -v``. The - options can have arguments, e.g. ``--input=FILE`` or ``-i FILE`` or - even ``-iFILE``. However it is important that you specify option - descriptions if you want for option to have an argument, a default - value, or specify synonymous short/long versions of option (see next - section on option descriptions). -- **commands** are words that do *not* follow the described above - conventions of ``--options`` or ``<arguments>`` or ``ARGUMENTS``, - plus two special commands: dash "``-``" and double dash "``--``" - (see below). - -Use the following constructs to specify patterns: - -- **[ ]** (brackets) **optional** elements. e.g.: ``my_program.py - [-hvqo FILE]`` -- **( )** (parens) **required** elements. All elements that are *not* - put in **[ ]** are also required, e.g.: ``my_program.py - --path=<path> <file>...`` is the same as ``my_program.py - (--path=<path> <file>...)``. (Note, "required options" might be not - a good idea for your users). -- **|** (pipe) **mutualy exclusive** elements. Group them using **( - )** if one of the mutually exclusive elements is required: - ``my_program.py (--clockwise | --counter-clockwise) TIME``. Group - them using **[ ]** if none of the mutually-exclusive elements are - required: ``my_program.py [--left | --right]``. -- **...** (ellipsis) **one or more** elements. To specify that - arbitrary number of repeating elements could be accepted, use - ellipsis (``...``), e.g. ``my_program.py FILE ...`` means one or - more ``FILE``-s are accepted. If you want to accept zero or more - elements, use brackets, e.g.: ``my_program.py [FILE ...]``. Ellipsis - works as a unary operator on the expression to the left. -- **[options]** (case sensitive) shortcut for any options. You can - use it if you want to specify that the usage pattern could be - provided with any options defined below in the option-descriptions - and do not want to enumerate them all in usage-pattern. - - "``[--]``". Double dash "``--``" is used by convention to separate - positional arguments that can be mistaken for options. In order to - support this convention add "``[--]``" to you usage patterns. - - "``[-]``". Single dash "``-``" is used by convention to signify that - ``stdin`` is used instead of a file. To support this add "``[-]``" - to you usage patterns. "``-``" act as a normal command. - -If your pattern allows to match argument-less option (a flag) several -times:: - - Usage: my_program.py [-v | -vv | -vvv] - -then number of occurences of the option will be counted. I.e. -``args['-v']`` will be ``2`` if program was invoked as ``my_program --vv``. Same works for commands. - -If your usage patterns allows to match same-named option with argument -or positional argument several times, the matched arguments will be -collected into a list:: - - Usage: my_program.py <file> <file> --path=<path>... - -I.e. invoked with ``my_program.py file1 file2 --path=./here ---path=./there`` the returned dict will contain ``args['<file>'] == -['file1', 'file2']`` and ``args['--path'] == ['./here', './there']``. - - -Option descriptions format ----------------------------------------------------------------------- - -**Option descriptions** consist of a list of options that you put -below your usage patterns. - -It is necessary to list option descriptions in order to specify: - -- synonymous short and long options, -- if an option has an argument, -- if option's argument has a default value. - -The rules are as follows: - -- Every line in ``doc`` that starts with ``-`` or ``--`` (not counting - spaces) is treated as an option description, e.g.:: - - Options: - --verbose # GOOD - -o FILE # GOOD - Other: --bad # BAD, line does not start with dash "-" - -- To specify that option has an argument, put a word describing that - argument after space (or equals "``=``" sign) as shown below. Follow - either <angular-brackets> or UPPER-CASE convention for options' - arguments. You can use comma if you want to separate options. In - the example below, both lines are valid, however you are recommended - to stick to a single style.:: - - -o FILE --output=FILE # without comma, with "=" sign - -i <file>, --input <file> # with comma, wihtout "=" sing - -- Use two spaces to separate options with their informal description:: - - --verbose More text. # BAD, will be treated as if verbose option had - # an argument "More", so use 2 spaces instead - -q Quit. # GOOD - -o FILE Output file. # GOOD - --stdout Use stdout. # GOOD, 2 spaces - -- If you want to set a default value for an option with an argument, - put it into the option-description, in form ``[default: - <my-default-value>]``:: - - --coefficient=K The K coefficient [default: 2.95] - --output=FILE Output file [default: test.txt] - --directory=DIR Some directory [default: ./] - -- If the option is not repeatable, the value inside ``[default: ...]`` - will be interpeted as string. If it *is* repeatable, it will be - splited into a list on whitespace:: - - Usage: my_program.py [--repeatable=<arg> --repeatable=<arg>] - [--another-repeatable=<arg>]... - [--not-repeatable=<arg>] - - # will be ['./here', './there'] - --repeatable=<arg> [default: ./here ./there] - - # will be ['./here'] - --another-repeatable=<arg> [default: ./here] - - # will be './here ./there', because it is not repeatable - --not-repeatable=<arg> [default: ./here ./there] - -Examples ----------------------------------------------------------------------- - -We have an extensive list of `examples -<https://github.com/docopt/docopt/tree/master/examples>`_ which cover -every aspect of functionality of **docopt**. Try them out, read the -source if in doubt. - -Subparsers, multi-level help and *huge* applications (like git) ----------------------------------------------------------------------- - -If you want to split your usage-pattern into several, implement -multi-level help (whith separate help-screen for each subcommand), -want to interface with existing scripts that don't use **docopt**, or -you're building the next "git", you will need the new ``options_first`` -parameter (described in API section above). To get you started quickly -we implemented a subset of git command-line interface as an example: -`examples/git -<https://github.com/docopt/docopt/tree/master/examples/git>`_ - - -Data validation ----------------------------------------------------------------------- - -**docopt** does one thing and does it well: it implements your -command-line interface. However it does not validate the input data. -On the other hand there are libraries like `python schema -<https://github.com/halst/schema>`_ which make validating data a -breeze. Take a look at `validation_example.py -<https://github.com/docopt/docopt/tree/master/examples/validation_example.py>`_ -which uses **schema** to validate data and report an error to the -user. - -Development -====================================================================== - -We would *love* to hear what you think about **docopt** on our `issues -page <http://github.com/docopt/docopt/issues>`_ - -Make pull requrests, report bugs, suggest ideas and discuss -**docopt**. You can also drop a line directly to -<vladi...@keleshev.com>. - -Porting ``docopt`` to other languages -====================================================================== - -We think **docopt** is so good, we want to share it beyond the Python -community! - -The follosing ports are available: - -- `Ruby port <http://github.com/docopt/docopt.rb>`_ -- `CoffeeScript port <http://github.com/docopt/docopt.coffee>`_ -- `Lua port <http://github.com/docopt/docopt.lua>`_ -- `PHP port <http://github.com/docopt/docopt.php>`_ - -But you can always create a port for your favorite language! You are -encouraged to use the Python version as a reference implementation. A -Language-agnostic test suite is bundled with `Python implementation -<http://github.com/docopt/docopt>`_. - -Porting discussion is on `issues page -<http://github.com/docopt/docopt/issues>`_. - -Changelog -====================================================================== - -**docopt** follows `semantic versioning <http://semver.org>`_. The -first release with stable API will be 1.0.0 (soon). Until then, you -are encouraged to specify explicitly the version in your dependency -tools, e.g.:: - - pip install docopt==0.6.2 - -- 0.6.2 `Wheel <http://pythonwheels.com/>`_ support. -- 0.6.1 Bugfix release. -- 0.6.0 ``options_first`` parameter. - **Breaking changes**: Corrected ``[options]`` meaning. - ``argv`` defaults to ``None``. -- 0.5.0 Repeated options/commands are counted or accumulated into a - list. -- 0.4.2 Bugfix release. -- 0.4.0 Option descriptions become optional, - support for "``--``" and "``-``" commands. -- 0.3.0 Support for (sub)commands like `git remote add`. - Introduce ``[options]`` shortcut for any options. - **Breaking changes**: ``docopt`` returns dictionary. -- 0.2.0 Usage pattern matching. Positional arguments parsing based on - usage patterns. - **Breaking changes**: ``docopt`` returns namespace (for arguments), - not list. Usage pattern is formalized. -- 0.1.0 Initial release. Options-parsing only (based on options - description). - - http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/6a81d1e7/env2/lib/python2.7/site-packages/docopt-0.6.2.dist-info/INSTALLER ---------------------------------------------------------------------- diff --git a/env2/lib/python2.7/site-packages/docopt-0.6.2.dist-info/INSTALLER b/env2/lib/python2.7/site-packages/docopt-0.6.2.dist-info/INSTALLER deleted file mode 100644 index a1b589e..0000000 --- a/env2/lib/python2.7/site-packages/docopt-0.6.2.dist-info/INSTALLER +++ /dev/null @@ -1 +0,0 @@ -pip