/usr/lib/python3/dist-packages/EasyProcess-0.2.3.egg-info/PKG-INFO is in python3-easyprocess 0.2.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 | Metadata-Version: 1.1
Name: EasyProcess
Version: 0.2.3
Summary: Easy to use python subprocess interface.
Home-page: https://github.com/ponty/easyprocess
Author: ponty
Author-email: UNKNOWN
License: BSD
Description: EasyProcess is an easy to use python subprocess interface.
Links:
* home: https://github.com/ponty/EasyProcess
* documentation: http://EasyProcess.readthedocs.org
* PYPI: https://pypi.python.org/pypi/EasyProcess
|Travis| |Coveralls| |Latest Version| |Supported Python versions| |License| |Downloads| |Code Health| |Documentation|
Features:
- layer on top of subprocess_ module
- easy to start, stop programs
- easy to get standard output/error, return code of programs
- command can be list or string
- logging
- timeout
- unit-tests
- cross-platform, development on linux
- global config file with program aliases
- shell is not supported
- pipes are not supported
- stdout/stderr is set only after the subprocess has finished
- stop() does not kill whole subprocess tree
- unicode support
- supported python versions: 2.6, 2.7, 3.3, 3.4, 3.5
- Method chaining_
Similar projects:
* execute (http://pypi.python.org/pypi/execute)
* commandwrapper (http://pypi.python.org/pypi/commandwrapper)
* extcmd (http://pypi.python.org/pypi/extcmd)
* sh (https://github.com/amoffat/sh)
* envoy (https://github.com/kennethreitz/envoy)
* plumbum (https://github.com/tomerfiliba/plumbum)
Basic usage
===========
>>> from easyprocess import EasyProcess
>>> EasyProcess('python --version').call().stderr
u'Python 2.6.6'
Installation
============
General
-------
* install pip_
* install the program::
# as root
pip install EasyProcess
Ubuntu 14.04
------------
::
sudo apt-get install python-pip
sudo pip install EasyProcess
Uninstall
---------
::
# as root
pip uninstall EasyProcess
Usage
=====
Simple example
--------------
Example program::
#-- include('examples/hello.py')--#
from easyprocess import EasyProcess
import sys
s = EasyProcess([sys.executable, '-c', 'print "hello"']).call().stdout
print(s)
#-#
Output::
#-- sh('python -m easyprocess.examples.hello')--#
hello
#-#
General
-------
The command can be a string list or a concatenated string::
#-- include('examples/cmd.py')--#
from easyprocess import EasyProcess
print('-- Run program, wait for it to complete, get stdout (command is string):')
s=EasyProcess('python -c "print 3"').call().stdout
print(s)
print('-- Run program, wait for it to complete, get stdout (command is list):')
s=EasyProcess(['python','-c','print 3']).call().stdout
print(s)
print('-- Run program, wait for it to complete, get stderr:')
s=EasyProcess('python --version').call().stderr
print(s)
print('-- Run program, wait for it to complete, get return code:')
s=EasyProcess('python --version').call().return_code
print(s)
print('-- Run program, wait 1 second, stop it, get stdout:')
s=EasyProcess('ping localhost').start().sleep(1).stop().stdout
print(s)
#-#
Output::
#-- sh('python -m easyprocess.examples.cmd')--#
-- Run program, wait for it to complete, get stdout (command is string):
3
-- Run program, wait for it to complete, get stdout (command is list):
3
-- Run program, wait for it to complete, get stderr:
Python 2.7.6
-- Run program, wait for it to complete, get return code:
0
-- Run program, wait 1 second, stop it, get stdout:
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.017 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.034 ms
#-#
Shell commands
--------------
Shell commands are not supported.
.. warning::
``echo`` is a shell command on Windows (there is no echo.exe),
but it is a program on Linux
return_code
-----------
:attr:`EasyProcess.return_code` is None until
:func:`EasyProcess.stop` or :func:`EasyProcess.wait`
is called.
With
----
By using :keyword:`with` statement the process is started
and stopped automatically::
from easyprocess import EasyProcess
with EasyProcess('ping 127.0.0.1') as proc: # start()
# communicate with proc
pass
# stopped
Equivalent with::
from easyprocess import EasyProcess
proc = EasyProcess('ping 127.0.0.1').start()
try:
# communicate with proc
pass
finally:
proc.stop()
Timeout
-------
This was implemented with "daemon thread".
"The entire Python program exits when only daemon threads are left."
http://docs.python.org/library/threading.html::
#-- include('examples/timeout.py')--#
from easyprocess import EasyProcess
s = EasyProcess('ping localhost').call(timeout=2).stdout
print(s)
#-#
Output::
#-- sh('python -m easyprocess.examples.timeout')--#
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.018 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.037 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.025 ms
#-#
Replacing existing functions
----------------------------
Replacing os.system::
retcode = os.system("ls -l")
==>
p = EasyProcess("ls -l").call()
retcode = p.return_code
print p.stdout
Replacing subprocess.call::
retcode = subprocess.call(["ls", "-l"])
==>
p = EasyProcess(["ls", "-l"]).call()
retcode = p.return_code
print p.stdout
.. _pip: http://pip.openplans.org/
.. _subprocess: http://docs.python.org/library/subprocess.html
.. _chaining: https://en.wikipedia.org/wiki/Method_chaining#Python
.. |Travis| image:: http://img.shields.io/travis/ponty/EasyProcess.svg
:target: https://travis-ci.org/ponty/EasyProcess/
.. |Coveralls| image:: http://img.shields.io/coveralls/ponty/EasyProcess/master.svg
:target: https://coveralls.io/r/ponty/EasyProcess/
.. |Latest Version| image:: https://img.shields.io/pypi/v/EasyProcess.svg
:target: https://pypi.python.org/pypi/EasyProcess/
.. |Supported Python versions| image:: https://img.shields.io/pypi/pyversions/EasyProcess.svg
:target: https://pypi.python.org/pypi/EasyProcess/
.. |License| image:: https://img.shields.io/pypi/l/EasyProcess.svg
:target: https://pypi.python.org/pypi/EasyProcess/
.. |Downloads| image:: https://img.shields.io/pypi/dm/EasyProcess.svg
:target: https://pypi.python.org/pypi/EasyProcess/
.. |Code Health| image:: https://landscape.io/github/ponty/EasyProcess/master/landscape.svg?style=flat
:target: https://landscape.io/github/ponty/EasyProcess/master
.. |Documentation| image:: https://readthedocs.org/projects/pyscreenshot/badge/?version=latest
:target: http://easyprocess.readthedocs.org
Keywords: subprocess interface
Platform: UNKNOWN
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
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
|