[Python-modules-commits] [easyprocess] 01/05: import easyprocess_0.2.2.orig.tar.gz

Sandro Tosi morph at moszumanska.debian.org
Mon Sep 19 12:52:44 UTC 2016


This is an automated email from the git hooks/post-receive script.

morph pushed a commit to branch master
in repository easyprocess.

commit 7cb4d5c08bf41b779efcfcbe08f5555d67f8f183
Author: Sandro Tosi <morph at debian.org>
Date:   Fri Sep 16 11:26:12 2016 -0400

    import easyprocess_0.2.2.orig.tar.gz
---
 EasyProcess.egg-info/PKG-INFO             | 273 +++++++++++++++++++
 EasyProcess.egg-info/SOURCES.txt          |  23 ++
 EasyProcess.egg-info/dependency_links.txt |   1 +
 EasyProcess.egg-info/top_level.txt        |   1 +
 LICENSE.txt                               |  24 ++
 MANIFEST.in                               |   7 +
 PKG-INFO                                  | 273 +++++++++++++++++++
 README.rst                                | 251 +++++++++++++++++
 docs/api.rst                              |   5 +
 docs/api/easyprocess.examples.rst         |  54 ++++
 docs/api/easyprocess.rst                  |  37 +++
 docs/api/modules.rst                      |   7 +
 docs/conf.py                              |  57 ++++
 docs/index.rst                            |  15 ++
 easyprocess/__init__.py                   | 434 ++++++++++++++++++++++++++++++
 easyprocess/about.py                      |   1 +
 easyprocess/examples/__init__.py          |   0
 easyprocess/examples/cmd.py               |  22 ++
 easyprocess/examples/hello.py             |   5 +
 easyprocess/examples/log.py               |  18 ++
 easyprocess/examples/timeout.py           |   4 +
 easyprocess/examples/ver.py               |   5 +
 easyprocess/unicodeutil.py                |  64 +++++
 setup.cfg                                 |   5 +
 setup.py                                  |  66 +++++
 25 files changed, 1652 insertions(+)

diff --git a/EasyProcess.egg-info/PKG-INFO b/EasyProcess.egg-info/PKG-INFO
new file mode 100644
index 0000000..ab5ab9d
--- /dev/null
+++ b/EasyProcess.egg-info/PKG-INFO
@@ -0,0 +1,273 @@
+Metadata-Version: 1.1
+Name: EasyProcess
+Version: 0.2.2
+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
diff --git a/EasyProcess.egg-info/SOURCES.txt b/EasyProcess.egg-info/SOURCES.txt
new file mode 100644
index 0000000..268e6c4
--- /dev/null
+++ b/EasyProcess.egg-info/SOURCES.txt
@@ -0,0 +1,23 @@
+LICENSE.txt
+MANIFEST.in
+README.rst
+setup.py
+EasyProcess.egg-info/PKG-INFO
+EasyProcess.egg-info/SOURCES.txt
+EasyProcess.egg-info/dependency_links.txt
+EasyProcess.egg-info/top_level.txt
+docs/api.rst
+docs/conf.py
+docs/index.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 --git a/EasyProcess.egg-info/dependency_links.txt b/EasyProcess.egg-info/dependency_links.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/EasyProcess.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
diff --git a/EasyProcess.egg-info/top_level.txt b/EasyProcess.egg-info/top_level.txt
new file mode 100644
index 0000000..756db07
--- /dev/null
+++ b/EasyProcess.egg-info/top_level.txt
@@ -0,0 +1 @@
+easyprocess
diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 0000000..d654680
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,24 @@
+Copyright (c) 2011, ponty
+All rights reserved.
+
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..3842158
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,7 @@
+graft docs
+include LICENSE*
+include TODO*
+include CHANGES*
+include README*
+include setup.py
+prune docs/_build
diff --git a/PKG-INFO b/PKG-INFO
new file mode 100644
index 0000000..ab5ab9d
--- /dev/null
+++ b/PKG-INFO
@@ -0,0 +1,273 @@
+Metadata-Version: 1.1
+Name: EasyProcess
+Version: 0.2.2
+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
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..77c64aa
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,251 @@
+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
+
+
+
+
+     
+
+   
diff --git a/docs/api.rst b/docs/api.rst
new file mode 100644
index 0000000..03a8bb3
--- /dev/null
+++ b/docs/api.rst
@@ -0,0 +1,5 @@
+API
+===
+
+.. automodule:: easyprocess
+        :members:
diff --git a/docs/api/easyprocess.examples.rst b/docs/api/easyprocess.examples.rst
new file mode 100644
index 0000000..146216b
--- /dev/null
+++ b/docs/api/easyprocess.examples.rst
@@ -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
... 833 lines suppressed ...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/easyprocess.git



More information about the Python-modules-commits mailing list