Hello community, here is the log from the commit of package python3-EasyProcess for openSUSE:Factory checked in at 2015-11-02 12:55:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python3-EasyProcess (Old) and /work/SRC/openSUSE:Factory/.python3-EasyProcess.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python3-EasyProcess" Changes: -------- --- /work/SRC/openSUSE:Factory/python3-EasyProcess/python3-EasyProcess.changes 2015-03-23 12:19:41.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.python3-EasyProcess.new/python3-EasyProcess.changes 2015-11-02 12:55:30.000000000 +0100 @@ -1,0 +2,11 @@ +Sun Nov 1 05:07:01 UTC 2015 - a...@gmx.de + +- update to version 0.2.1: + (no changelog) + +- changes from version 0.2.0: + (no complete changelog) + * drop support for py32 + * add support for py35 + +------------------------------------------------------------------- Old: ---- EasyProcess-0.1.9.tar.gz New: ---- EasyProcess-0.2.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python3-EasyProcess.spec ++++++ --- /var/tmp/diff_new_pack.RZx3sn/_old 2015-11-02 12:55:31.000000000 +0100 +++ /var/tmp/diff_new_pack.RZx3sn/_new 2015-11-02 12:55:31.000000000 +0100 @@ -17,7 +17,7 @@ Name: python3-EasyProcess -Version: 0.1.9 +Version: 0.2.1 Release: 0 Url: https://github.com/ponty/easyprocess Summary: Easy to use python subprocess interface ++++++ EasyProcess-0.1.9.tar.gz -> EasyProcess-0.2.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/EasyProcess-0.1.9/EasyProcess.egg-info/PKG-INFO new/EasyProcess-0.2.1/EasyProcess.egg-info/PKG-INFO --- old/EasyProcess-0.1.9/EasyProcess.egg-info/PKG-INFO 2015-03-19 21:50:05.000000000 +0100 +++ new/EasyProcess-0.2.1/EasyProcess.egg-info/PKG-INFO 2015-10-30 09:34:46.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: EasyProcess -Version: 0.1.9 +Version: 0.2.1 Summary: Easy to use python subprocess interface. Home-page: https://github.com/ponty/easyprocess Author: ponty @@ -10,9 +10,10 @@ Links: * home: https://github.com/ponty/EasyProcess - * documentation: http://ponty.github.com/EasyProcess + * documentation: http://EasyProcess.readthedocs.org + * PYPI: https://pypi.python.org/pypi/EasyProcess - |Travis| |Coveralls| |Latest Version| |Supported Python versions| |License| |Downloads| |Code Health| + |Travis| |Coveralls| |Latest Version| |Supported Python versions| |License| |Downloads| |Code Health| |Documentation| Features: - layer on top of subprocess_ module @@ -29,11 +30,8 @@ - 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.2, 3.3, 3.4 + - supported python versions: 2.6, 2.7, 3.3, 3.4, 3.5 - Known problems: - - none - Similar projects: * execute (http://pypi.python.org/pypi/execute) * commandwrapper (http://pypi.python.org/pypi/commandwrapper) @@ -61,8 +59,8 @@ # as root pip install EasyProcess - Ubuntu - ------ + Ubuntu 14.04 + ------------ :: sudo apt-get install python-pip @@ -76,23 +74,180 @@ pip uninstall EasyProcess - .. _setuptools: http://peak.telecommunity.com/DevCenter/EasyInstall + 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 + .. |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://pypip.in/version/EasyProcess/badge.svg?style=flat + .. |Latest Version| image:: https://img.shields.io/pypi/v/EasyProcess.svg :target: https://pypi.python.org/pypi/EasyProcess/ - .. |Supported Python versions| image:: https://pypip.in/py_versions/EasyProcess/badge.svg?style=flat + .. |Supported Python versions| image:: https://img.shields.io/pypi/pyversions/EasyProcess.svg :target: https://pypi.python.org/pypi/EasyProcess/ - .. |License| image:: https://pypip.in/license/EasyProcess/badge.svg?style=flat + .. |License| image:: https://img.shields.io/pypi/l/EasyProcess.svg :target: https://pypi.python.org/pypi/EasyProcess/ - .. |Downloads| image:: https://pypip.in/download/EasyProcess/badge.svg?style=flat + .. |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 @@ -100,6 +255,7 @@ + Keywords: subprocess interface Platform: UNKNOWN Classifier: License :: OSI Approved :: BSD License @@ -110,6 +266,6 @@ Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.2 Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: 3.4 +Classifier: Programming Language :: Python :: 3.5 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/EasyProcess-0.1.9/EasyProcess.egg-info/SOURCES.txt new/EasyProcess-0.2.1/EasyProcess.egg-info/SOURCES.txt --- old/EasyProcess-0.1.9/EasyProcess.egg-info/SOURCES.txt 2015-03-19 21:50:05.000000000 +0100 +++ new/EasyProcess-0.2.1/EasyProcess.egg-info/SOURCES.txt 2015-10-30 09:34:46.000000000 +0100 @@ -1,7 +1,6 @@ LICENSE.txt MANIFEST.in README.rst -TODO pavement.py setup.py EasyProcess.egg-info/PKG-INFO @@ -11,12 +10,15 @@ docs/api.rst docs/conf.py docs/index.rst -docs/links.rst -docs/readme.rst -docs/usage.rst +docs/api/easyprocess.examples.rst +docs/api/easyprocess.rst +docs/api/modules.rst easyprocess/__init__.py easyprocess/about.py easyprocess/unicodeutil.py easyprocess/examples/__init__.py +easyprocess/examples/cmd.py +easyprocess/examples/hello.py easyprocess/examples/log.py +easyprocess/examples/timeout.py easyprocess/examples/ver.py \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/EasyProcess-0.1.9/PKG-INFO new/EasyProcess-0.2.1/PKG-INFO --- old/EasyProcess-0.1.9/PKG-INFO 2015-03-19 21:50:05.000000000 +0100 +++ new/EasyProcess-0.2.1/PKG-INFO 2015-10-30 09:34:46.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: EasyProcess -Version: 0.1.9 +Version: 0.2.1 Summary: Easy to use python subprocess interface. Home-page: https://github.com/ponty/easyprocess Author: ponty @@ -10,9 +10,10 @@ Links: * home: https://github.com/ponty/EasyProcess - * documentation: http://ponty.github.com/EasyProcess + * documentation: http://EasyProcess.readthedocs.org + * PYPI: https://pypi.python.org/pypi/EasyProcess - |Travis| |Coveralls| |Latest Version| |Supported Python versions| |License| |Downloads| |Code Health| + |Travis| |Coveralls| |Latest Version| |Supported Python versions| |License| |Downloads| |Code Health| |Documentation| Features: - layer on top of subprocess_ module @@ -29,11 +30,8 @@ - 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.2, 3.3, 3.4 + - supported python versions: 2.6, 2.7, 3.3, 3.4, 3.5 - Known problems: - - none - Similar projects: * execute (http://pypi.python.org/pypi/execute) * commandwrapper (http://pypi.python.org/pypi/commandwrapper) @@ -61,8 +59,8 @@ # as root pip install EasyProcess - Ubuntu - ------ + Ubuntu 14.04 + ------------ :: sudo apt-get install python-pip @@ -76,23 +74,180 @@ pip uninstall EasyProcess - .. _setuptools: http://peak.telecommunity.com/DevCenter/EasyInstall + 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 + .. |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://pypip.in/version/EasyProcess/badge.svg?style=flat + .. |Latest Version| image:: https://img.shields.io/pypi/v/EasyProcess.svg :target: https://pypi.python.org/pypi/EasyProcess/ - .. |Supported Python versions| image:: https://pypip.in/py_versions/EasyProcess/badge.svg?style=flat + .. |Supported Python versions| image:: https://img.shields.io/pypi/pyversions/EasyProcess.svg :target: https://pypi.python.org/pypi/EasyProcess/ - .. |License| image:: https://pypip.in/license/EasyProcess/badge.svg?style=flat + .. |License| image:: https://img.shields.io/pypi/l/EasyProcess.svg :target: https://pypi.python.org/pypi/EasyProcess/ - .. |Downloads| image:: https://pypip.in/download/EasyProcess/badge.svg?style=flat + .. |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 @@ -100,6 +255,7 @@ + Keywords: subprocess interface Platform: UNKNOWN Classifier: License :: OSI Approved :: BSD License @@ -110,6 +266,6 @@ Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.2 Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: 3.4 +Classifier: Programming Language :: Python :: 3.5 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/EasyProcess-0.1.9/README.rst new/EasyProcess-0.2.1/README.rst --- old/EasyProcess-0.1.9/README.rst 2015-03-19 20:36:07.000000000 +0100 +++ new/EasyProcess-0.2.1/README.rst 2015-10-30 09:32:54.000000000 +0100 @@ -2,9 +2,10 @@ Links: * home: https://github.com/ponty/EasyProcess - * documentation: http://ponty.github.com/EasyProcess + * documentation: http://EasyProcess.readthedocs.org + * PYPI: https://pypi.python.org/pypi/EasyProcess -|Travis| |Coveralls| |Latest Version| |Supported Python versions| |License| |Downloads| |Code Health| +|Travis| |Coveralls| |Latest Version| |Supported Python versions| |License| |Downloads| |Code Health| |Documentation| Features: - layer on top of subprocess_ module @@ -21,11 +22,8 @@ - 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.2, 3.3, 3.4 + - supported python versions: 2.6, 2.7, 3.3, 3.4, 3.5 -Known problems: - - none - Similar projects: * execute (http://pypi.python.org/pypi/execute) * commandwrapper (http://pypi.python.org/pypi/commandwrapper) @@ -53,8 +51,8 @@ # as root pip install EasyProcess -Ubuntu ------- +Ubuntu 14.04 +------------ :: sudo apt-get install python-pip @@ -68,27 +66,184 @@ pip uninstall EasyProcess -.. _setuptools: http://peak.telecommunity.com/DevCenter/EasyInstall +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 + .. |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://pypip.in/version/EasyProcess/badge.svg?style=flat +.. |Latest Version| image:: https://img.shields.io/pypi/v/EasyProcess.svg :target: https://pypi.python.org/pypi/EasyProcess/ -.. |Supported Python versions| image:: https://pypip.in/py_versions/EasyProcess/badge.svg?style=flat +.. |Supported Python versions| image:: https://img.shields.io/pypi/pyversions/EasyProcess.svg :target: https://pypi.python.org/pypi/EasyProcess/ -.. |License| image:: https://pypip.in/license/EasyProcess/badge.svg?style=flat +.. |License| image:: https://img.shields.io/pypi/l/EasyProcess.svg :target: https://pypi.python.org/pypi/EasyProcess/ -.. |Downloads| image:: https://pypip.in/download/EasyProcess/badge.svg?style=flat +.. |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 - \ No newline at end of file + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/EasyProcess-0.1.9/TODO new/EasyProcess-0.2.1/TODO --- old/EasyProcess-0.1.9/TODO 2011-04-12 09:29:41.000000000 +0200 +++ new/EasyProcess-0.2.1/TODO 1970-01-01 01:00:00.000000000 +0100 @@ -1,5 +0,0 @@ - -- stop() does not kill all subprocess tree - http://stackoverflow.com/questions/1191374/subprocess-with-timeout - http://code.google.com/p/psutil/ -- unit test for alias \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/EasyProcess-0.1.9/docs/api/easyprocess.examples.rst new/EasyProcess-0.2.1/docs/api/easyprocess.examples.rst --- old/EasyProcess-0.1.9/docs/api/easyprocess.examples.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/EasyProcess-0.2.1/docs/api/easyprocess.examples.rst 2015-10-28 06:24:43.000000000 +0100 @@ -0,0 +1,54 @@ +easyprocess.examples package +============================ + +Submodules +---------- + +easyprocess.examples.cmd module +------------------------------- + +.. automodule:: easyprocess.examples.cmd + :members: + :undoc-members: + :show-inheritance: + +easyprocess.examples.hello module +--------------------------------- + +.. automodule:: easyprocess.examples.hello + :members: + :undoc-members: + :show-inheritance: + +easyprocess.examples.log module +------------------------------- + +.. automodule:: easyprocess.examples.log + :members: + :undoc-members: + :show-inheritance: + +easyprocess.examples.timeout module +----------------------------------- + +.. automodule:: easyprocess.examples.timeout + :members: + :undoc-members: + :show-inheritance: + +easyprocess.examples.ver module +------------------------------- + +.. automodule:: easyprocess.examples.ver + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: easyprocess.examples + :members: + :undoc-members: + :show-inheritance: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/EasyProcess-0.1.9/docs/api/easyprocess.rst new/EasyProcess-0.2.1/docs/api/easyprocess.rst --- old/EasyProcess-0.1.9/docs/api/easyprocess.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/EasyProcess-0.2.1/docs/api/easyprocess.rst 2015-10-28 06:24:43.000000000 +0100 @@ -0,0 +1,37 @@ +easyprocess package +=================== + +Subpackages +----------- + +.. toctree:: + + easyprocess.examples + +Submodules +---------- + +easyprocess.about module +------------------------ + +.. automodule:: easyprocess.about + :members: + :undoc-members: + :show-inheritance: + +easyprocess.unicodeutil module +------------------------------ + +.. automodule:: easyprocess.unicodeutil + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: easyprocess + :members: + :undoc-members: + :show-inheritance: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/EasyProcess-0.1.9/docs/api/modules.rst new/EasyProcess-0.2.1/docs/api/modules.rst --- old/EasyProcess-0.1.9/docs/api/modules.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/EasyProcess-0.2.1/docs/api/modules.rst 2015-10-28 06:24:43.000000000 +0100 @@ -0,0 +1,7 @@ +easyprocess +=========== + +.. toctree:: + :maxdepth: 4 + + easyprocess diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/EasyProcess-0.1.9/docs/conf.py new/EasyProcess-0.2.1/docs/conf.py --- old/EasyProcess-0.1.9/docs/conf.py 2015-03-19 20:36:07.000000000 +0100 +++ new/EasyProcess-0.2.1/docs/conf.py 2015-10-28 06:24:43.000000000 +0100 @@ -1,28 +1,26 @@ -from path import path -import logging -import sphinx +import os import sys -sys.path.append('..') -import easyprocess -sys.path.pop() -release = easyprocess.__version__ -print release project = 'EasyProcess' author = 'ponty' copyright = '2011, ponty' +__version__ = None +exec(open(os.path.join('..', project.lower(), 'about.py')).read()) +release = __version__ + # logging.basicConfig(level=logging.DEBUG) +sys.path.insert(0, os.path.abspath('..')) # Extension extensions = [ # -*-Extensions: -*- 'sphinx.ext.autodoc', - 'sphinxcontrib.programoutput', +# 'sphinxcontrib.programoutput', # 'sphinxcontrib.programscreenshot', 'sphinx.ext.graphviz', - 'sphinxcontrib.autorun', +# 'sphinxcontrib.autorun', #'sphinx.ext.autosummary', 'sphinx.ext.intersphinx', ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/EasyProcess-0.1.9/docs/index.rst new/EasyProcess-0.2.1/docs/index.rst --- old/EasyProcess-0.1.9/docs/index.rst 2012-03-09 11:04:00.000000000 +0100 +++ new/EasyProcess-0.2.1/docs/index.rst 2015-10-28 06:24:43.000000000 +0100 @@ -1,22 +1,15 @@ -**EasyProcess** +=========== +EasyProcess +=========== -:Date: |today| -:PDF: `EasyProcess.pdf <EasyProcess.pdf>`_ -Contents: +About +===== -.. toctree:: - :maxdepth: 2 - readme - usage - api - -Indices and tables -================== +.. include:: ../README.rst + +.. include:: api.rst -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/EasyProcess-0.1.9/docs/links.rst new/EasyProcess-0.2.1/docs/links.rst --- old/EasyProcess-0.1.9/docs/links.rst 2011-05-16 16:14:01.000000000 +0200 +++ new/EasyProcess-0.2.1/docs/links.rst 1970-01-01 01:00:00.000000000 +0100 @@ -1,18 +0,0 @@ -.. _scons: http://www.scons.org -.. _sphinx: http://sphinx.pocoo.org -.. _github: https://github.com/ -.. _paver: http://paver.github.com/paver/ -.. _setuptools: http://peak.telecommunity.com/DevCenter/EasyInstall -.. _pip: http://pip.openplans.org/ -.. _nose: http://somethingaboutorange.com/mrl/projects/nose/1.0.0/ -.. _ghp-import: https://github.com/davisp/ghp-import -.. _pyflakes: http://pypi.python.org/pypi/pyflakes -.. _pychecker: http://pychecker.sourceforge.net/ -.. _pypi: http://pypi.python.org/pypi -.. _`paved fork`: https://github.com/ponty/paved -.. _sphinx-contrib: https://bitbucket.org/birkenfeld/sphinx-contrib/ -.. _sphinxcontrib-programscreenshot: https://github.com/ponty/sphinxcontrib-programscreenshot -.. _sphinxcontrib-programoutput: http://packages.python.org/sphinxcontrib-programoutput/ -.. _sphinxcontrib-paverutils: http://pypi.python.org/pypi/sphinxcontrib-paverutils - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/EasyProcess-0.1.9/docs/readme.rst new/EasyProcess-0.2.1/docs/readme.rst --- old/EasyProcess-0.1.9/docs/readme.rst 2011-02-11 11:24:03.000000000 +0100 +++ new/EasyProcess-0.2.1/docs/readme.rst 1970-01-01 01:00:00.000000000 +0100 @@ -1,5 +0,0 @@ -About -====== - - -.. include:: ../README.rst diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/EasyProcess-0.1.9/docs/usage.rst new/EasyProcess-0.2.1/docs/usage.rst --- old/EasyProcess-0.1.9/docs/usage.rst 2012-03-09 10:58:57.000000000 +0100 +++ new/EasyProcess-0.2.1/docs/usage.rst 1970-01-01 01:00:00.000000000 +0100 @@ -1,189 +0,0 @@ -Usage -================== - -.. module:: easyprocess - -Simple example ---------------- - -Example program: - -.. literalinclude:: ../easyprocess/examples/ver.py - -Output: - -.. program-output:: python -m easyprocess.examples.ver - :prompt: - - -General --------- - -.. runblock:: pycon - - >>> from easyprocess import EasyProcess - >>> - >>> # Run program, wait for it to complete, get stdout (command is string): - >>> EasyProcess('python -c "print 3"').call().stdout - >>> - >>> # Run program, wait for it to complete, get stdout (command is list): - >>> EasyProcess(['python','-c','print 3']).call().stdout - >>> - >>> # Run program, wait for it to complete, get stderr: - >>> EasyProcess('python --version').call().stderr - >>> - >>> # Run program, wait for it to complete, get return code: - >>> EasyProcess('python --version').call().return_code - >>> - >>> # Run program, wait 1 second, stop it, get stdout: - >>> print EasyProcess('ping localhost').start().sleep(1).stop().stdout - >>> - >>> # Unicode support - >>> EasyProcess(['python','-c','print unichr(0x03A9).encode("utf-8")']).call().stdout - >>> - -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. - - -.. runblock:: pycon - - >>> from easyprocess import EasyProcess - >>> - >>> # process has finished but no stop() or wait() was called - >>> print EasyProcess('echo hello').start().sleep(0.5).return_code - >>> - >>> # wait() - >>> print EasyProcess('echo hello').start().wait().return_code - >>> - >>> # stop() after process has finished - >>> print EasyProcess('echo hello').start().sleep(0.5).stop().return_code - >>> - >>> # stop() before process has finished - >>> print EasyProcess('sleep 2').start().stop().return_code - >>> - >>> # same as start().wait().stop() - >>> print EasyProcess('echo hello').call().return_code - -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 - -.. runblock:: pycon - - >>> from easyprocess import EasyProcess - >>> # Run ping with timeout - >>> print EasyProcess('ping localhost').call(timeout=1).stdout - -Logging --------- - -Example program: - -.. literalinclude:: ../easyprocess/examples/log.py - -Output: - -.. program-output:: python -m easyprocess.examples.log - :prompt: - -Alias --------- - -You can define an alias for EasyProcess calls -by editing your config file ($HOME/.easyprocess.cfg) -This can be used for: - - * testing different version of the same program - * redirect calls - * program path can be defined here. (Installed programs are not in $PATH on Windows) - -start python and print python version:: - - >>> from easyprocess import EasyProcess - >>> EasyProcess('python --version').call().stderr - 'Python 2.6.6' - -edit the config file: $HOME/.easyprocess.cfg:: - - [link] - python=/usr/bin/python2.7 - -restart python and print python version again:: - - >>> from easyprocess import EasyProcess - >>> EasyProcess('python --version').call().stderr - 'Python 2.7.0+' - - -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 - - -extract_version --------------------- - -.. autofunction:: easyprocess.extract_version - -.. runblock:: pycon - - >>> from easyprocess import EasyProcess, extract_version - >>> print extract_version(EasyProcess('python --version').call().stderr) - \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/EasyProcess-0.1.9/easyprocess/__init__.py new/EasyProcess-0.2.1/easyprocess/__init__.py --- old/EasyProcess-0.1.9/easyprocess/__init__.py 2015-03-19 20:36:07.000000000 +0100 +++ new/EasyProcess-0.2.1/easyprocess/__init__.py 2015-10-28 06:24:43.000000000 +0100 @@ -11,7 +11,7 @@ import tempfile import threading import time -import ConfigParser +# import ConfigParser from easyprocess.about import __version__ @@ -20,7 +20,7 @@ log.debug('version=%s', __version__) -CONFIG_FILE = '.easyprocess.cfg' +# CONFIG_FILE = '.easyprocess.cfg' SECTION_LINK = 'link' POLL_TIME = 0.1 USE_POLL = 0 @@ -81,7 +81,7 @@ pipes can cause deadlock in some cases (see unit tests) ''' - config = None +# config = None def __init__(self, cmd, ubuntu_package=None, url=None, cwd=None, use_temp_files=True): self.use_temp_files = use_temp_files @@ -113,23 +113,23 @@ if not len(cmd): raise EasyProcessError(self, 'empty command!') - if not Proc.config: - conf_file = os.path.join(os.path.expanduser('~'), CONFIG_FILE) - log.debug('reading config: %s', conf_file) - Proc.config = ConfigParser.RawConfigParser() - Proc.config.read(conf_file) - - self.alias = None - try: - self.alias = Proc.config.get(SECTION_LINK, self.cmd[0]) - except ConfigParser.NoSectionError: - pass - except ConfigParser.NoOptionError: - pass - - if self.alias: - log.debug('alias found: %s', self.alias) - self.cmd[0] = self.alias +# if not Proc.config: +# conf_file = os.path.join(os.path.expanduser('~'), CONFIG_FILE) +# log.debug('reading config: %s', conf_file) +# Proc.config = ConfigParser.RawConfigParser() +# Proc.config.read(conf_file) + +# self.alias = None +# try: +# self.alias = Proc.config.get(SECTION_LINK, self.cmd[0]) +# except ConfigParser.NoSectionError: +# pass +# except ConfigParser.NoOptionError: +# pass + +# if self.alias: +# log.debug('alias found: %s', self.alias) +# self.cmd[0] = self.alias def __repr__(self): msg = '<%s cmd_param=%s cmd=%s oserror=%s returncode=%s stdout="%s" stderr="%s" timeout=%s>' % ( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/EasyProcess-0.1.9/easyprocess/about.py new/EasyProcess-0.2.1/easyprocess/about.py --- old/EasyProcess-0.1.9/easyprocess/about.py 2015-03-19 21:49:40.000000000 +0100 +++ new/EasyProcess-0.2.1/easyprocess/about.py 2015-10-30 09:33:44.000000000 +0100 @@ -1 +1 @@ -__version__ = '0.1.9' +__version__ = '0.2.1' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/EasyProcess-0.1.9/easyprocess/examples/cmd.py new/EasyProcess-0.2.1/easyprocess/examples/cmd.py --- old/EasyProcess-0.1.9/easyprocess/examples/cmd.py 1970-01-01 01:00:00.000000000 +0100 +++ new/EasyProcess-0.2.1/easyprocess/examples/cmd.py 2015-10-28 06:24:43.000000000 +0100 @@ -0,0 +1,22 @@ +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) + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/EasyProcess-0.1.9/easyprocess/examples/hello.py new/EasyProcess-0.2.1/easyprocess/examples/hello.py --- old/EasyProcess-0.1.9/easyprocess/examples/hello.py 1970-01-01 01:00:00.000000000 +0100 +++ new/EasyProcess-0.2.1/easyprocess/examples/hello.py 2015-10-28 06:24:43.000000000 +0100 @@ -0,0 +1,5 @@ +from easyprocess import EasyProcess +import sys + +s = EasyProcess([sys.executable, '-c', 'print "hello"']).call().stdout +print(s) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/EasyProcess-0.1.9/easyprocess/examples/timeout.py new/EasyProcess-0.2.1/easyprocess/examples/timeout.py --- old/EasyProcess-0.1.9/easyprocess/examples/timeout.py 1970-01-01 01:00:00.000000000 +0100 +++ new/EasyProcess-0.2.1/easyprocess/examples/timeout.py 2015-10-28 06:24:43.000000000 +0100 @@ -0,0 +1,4 @@ +from easyprocess import EasyProcess + +s = EasyProcess('ping localhost').call(timeout=2).stdout +print(s) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/EasyProcess-0.1.9/pavement.py new/EasyProcess-0.2.1/pavement.py --- old/EasyProcess-0.1.9/pavement.py 2015-03-19 21:35:42.000000000 +0100 +++ new/EasyProcess-0.2.1/pavement.py 2015-10-28 06:24:43.000000000 +0100 @@ -1,76 +1,26 @@ -from paver.easy import * +from path import Path +from paver.doctools import cog, html +from paver.easy import options +from paver.options import Bunch from paver.setuputils import setup -import paver.doctools -import paver.misctasks -from paved import * -from paved.dist import * -from paved.util import * -from paved.docs import * -from paved.pycheck import * -from paved.pkg import * -from setuptools import find_packages -import sys - -# get info from setup.py -sys.path.append('.') -setup_py = ''.join( - [x for x in path('setup.py').lines() if 'distutils' not in x]) -exec(setup_py) -sys.path.pop() +IMPORTS=[cog, html, setup] + options( - sphinx=Bunch( - docroot='docs', - builddir="_build", - ), -# pdf=Bunch( -# builddir='_build', -# builder='latex', -# ), + cog=Bunch( + basedir='.', + pattern='README.rst', + includedir='easyprocess', + beginspec='#--', + endspec='--#', + endoutput='#-#', + ) ) -options.paved.clean.rmdirs += ['.tox', - 'dist', - 'build', - ] -options.paved.clean.patterns += ['*.pickle', - '*.doctree', - '*.gz', - 'nosetests.xml', - 'sloccount.sc', - '*.pdf', '*.tex', - '*.png', - '*.zip', - 'distribute_setup.py', - ] - -options.paved.dist.manifest.include.remove('distribute_setup.py') -options.paved.dist.manifest.include.remove('paver-minilib.zip') -# options.paved.dist.manifest.include.add('requirements.txt') -# options.paved.dist.manifest.include.add('versioneer.py') - - -@task -@needs( - 'sloccount', - 'html', - 'pdf', - 'sdist', - 'nose', - 'tox', -) -def alltest(): - 'all tasks to check' - pass - +# get info from setup.py +setup_py = ''.join( + [x for x in Path('setup.py').lines() if 'setuptools' not in x]) +exec(setup_py) -@task -@needs('manifest', - 'distutils.command.sdist', - ) -def sdist(): - """Overrides sdist to make sure that our MANIFEST.in is generated. - """ - pass diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/EasyProcess-0.1.9/setup.py new/EasyProcess-0.2.1/setup.py --- old/EasyProcess-0.1.9/setup.py 2015-03-19 21:46:43.000000000 +0100 +++ new/EasyProcess-0.2.1/setup.py 2015-10-28 06:24:43.000000000 +0100 @@ -2,6 +2,12 @@ import sys import os +if os.environ.get('distutils_issue8876_workaround_enabled', False): + # sdist_hack: Remove reference to os.link to disable using hardlinks when + # building setup.py's sdist target. This is done because + # VirtualBox VMs shared filesystems don't support hardlinks. + del os.link + NAME = 'easyprocess' PYPI_NAME = 'EasyProcess' URL = 'https://github.com/ponty/easyprocess' @@ -37,9 +43,10 @@ "Programming Language :: Python :: 3", # "Programming Language :: Python :: 3.0", # "Programming Language :: Python :: 3.1", - "Programming Language :: Python :: 3.2", +# "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", ]