[Python-modules-commits] [pyvirtualdisplay] 01/09: import pyvirtualdisplay_0.2.orig.tar.gz

Sandro Tosi morph at moszumanska.debian.org
Thu Sep 22 11:31:40 UTC 2016


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

morph pushed a commit to branch master
in repository pyvirtualdisplay.

commit c821982c3226409e77e26a99a09e54d2616d0ac5
Author: Sandro Tosi <morph at debian.org>
Date:   Thu Sep 15 07:36:14 2016 -0400

    import pyvirtualdisplay_0.2.orig.tar.gz
---
 LICENSE.txt                                    |  24 +++
 MANIFEST.in                                    |  10 ++
 PKG-INFO                                       | 198 +++++++++++++++++++++++++
 PyVirtualDisplay.egg-info/PKG-INFO             | 198 +++++++++++++++++++++++++
 PyVirtualDisplay.egg-info/SOURCES.txt          |  33 +++++
 PyVirtualDisplay.egg-info/dependency_links.txt |   1 +
 PyVirtualDisplay.egg-info/requires.txt         |   1 +
 PyVirtualDisplay.egg-info/top_level.txt        |   1 +
 README.rst                                     | 176 ++++++++++++++++++++++
 docs/.gitignore                                |   1 +
 docs/__init__.py                               |   0
 docs/_img/lowres.png                           | Bin 0 -> 17752 bytes
 docs/_img/screenshot3.png                      | Bin 0 -> 510 bytes
 docs/api.rst                                   |  14 ++
 docs/conf.py                                   |  55 +++++++
 docs/index.rst                                 |  17 +++
 docs/screenshot.py                             |  19 +++
 docs/struct.rst                                |  38 +++++
 pavement.py                                    |  25 ++++
 pyvirtualdisplay/__init__.py                   |  10 ++
 pyvirtualdisplay/about.py                      |   1 +
 pyvirtualdisplay/abstractdisplay.py            | 111 ++++++++++++++
 pyvirtualdisplay/display.py                    |  58 ++++++++
 pyvirtualdisplay/examples/__init__.py          |   0
 pyvirtualdisplay/examples/lowres.py            |   6 +
 pyvirtualdisplay/examples/screenshot1.py       |  10 ++
 pyvirtualdisplay/examples/screenshot3.py       |  13 ++
 pyvirtualdisplay/examples/vncserver.py         |  11 ++
 pyvirtualdisplay/smartdisplay.py               |  90 +++++++++++
 pyvirtualdisplay/xephyr.py                     |  40 +++++
 pyvirtualdisplay/xvfb.py                       |  53 +++++++
 pyvirtualdisplay/xvnc.py                       |  43 ++++++
 requirements.txt                               |   3 +
 setup.cfg                                      |   5 +
 setup.py                                       |  72 +++++++++
 35 files changed, 1337 insertions(+)

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..14d7838
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,10 @@
+graft docs
+include LICENSE*
+include pavement.py
+include TODO*
+include requirements.txt
+include versioneer.py
+include CHANGES*
+include README*
+include setup.py
+prune docs/_build
diff --git a/PKG-INFO b/PKG-INFO
new file mode 100644
index 0000000..035545f
--- /dev/null
+++ b/PKG-INFO
@@ -0,0 +1,198 @@
+Metadata-Version: 1.1
+Name: PyVirtualDisplay
+Version: 0.2
+Summary: python wrapper for Xvfb, Xephyr and Xvnc
+Home-page: https://github.com/ponty/pyvirtualdisplay
+Author: ponty
+Author-email: UNKNOWN
+License: BSD
+Description: pyvirtualdisplay is a python wrapper for Xvfb_, Xephyr_ and Xvnc_
+        
+        Links:
+         * home: https://github.com/ponty/pyvirtualdisplay
+         * documentation: http://pyvirtualdisplay.readthedocs.org
+         * PYPI: https://pypi.python.org/pypi/pyvirtualdisplay
+        
+        |Travis| |Coveralls| |Latest Version| |Supported Python versions| |License| |Downloads| |Code Health| |Documentation|
+        
+        Features:
+         - python wrapper
+         - supported python versions: 2.6, 2.7, 3.3, 3.4, 3.5
+         - back-ends: Xvfb_, Xephyr_, Xvnc_
+        
+        .. warning:: at least one back-end should be installed
+        
+        Known problems:
+         - only a few back-end options are supported
+        
+        Possible applications:
+         * GUI testing
+         * automatic GUI screenshot
+        
+        Basic usages
+        ============
+        
+        Start Xephyr::
+        
+            from pyvirtualdisplay import Display
+            xephyr=Display(visible=1, size=(320, 240)).start()
+        
+        Create screenshot of xmessage with Xvfb::
+        
+            from easyprocess import EasyProcess
+            from pyvirtualdisplay.smartdisplay import SmartDisplay
+            with SmartDisplay(visible=0, bgcolor='black') as disp:
+                with EasyProcess('xmessage hello'):
+                    img = disp.waitgrab()
+            img.show()
+        
+        Installation
+        ============
+        
+        General
+        -------
+        
+         * install Xvfb_ or Xephyr_ or Xvnc_.
+         * install pip_
+         * optional: pyscreenshot_ and PIL_ should be installed for ``smartdisplay`` submodule
+         * install the program::
+        
+            # as root
+            pip install pyvirtualdisplay
+        
+        Ubuntu 14.04
+        ------------
+        ::
+        
+            sudo apt-get install python-pip
+            sudo apt-get install xvfb xserver-xephyr vnc4server
+            sudo pip install pyvirtualdisplay
+            # optional
+            sudo apt-get install python-pil scrot
+            sudo pip install pyscreenshot
+            # optional for examples
+            sudo pip install entrypoint2
+        
+        
+        Uninstall
+        ---------
+        
+        ::
+        
+            # as root
+            pip uninstall pyvirtualdisplay
+        
+        
+        Usage
+        =====
+        
+        ..  #-- from docs.screenshot import screenshot--#  
+        ..  #-#
+        
+        GUI Test
+        --------
+        
+        Testing ``gnumeric`` on low resolution::
+        
+          #-- include('examples/lowres.py') --#
+          from easyprocess import EasyProcess
+          from pyvirtualdisplay import Display
+        
+          if __name__ == "__main__":
+              Display(visible=1, size=(320, 240)).start()
+              EasyProcess('gnumeric').start()
+          #-#
+        
+        Image:
+        
+        .. #-- screenshot('python -m pyvirtualdisplay.examples.lowres','lowres.png') --#
+        .. image:: _img/lowres.png
+        .. #-#
+        
+        Screenshot
+        ----------
+        
+        Create screenshot of ``xmessage`` in background::
+        
+          #-- include('examples/screenshot3.py') --#
+          '''
+          using :keyword:`with` statement
+          '''
+          from easyprocess import EasyProcess
+          from pyvirtualdisplay.smartdisplay import SmartDisplay
+        
+          if __name__ == "__main__":
+              with SmartDisplay(visible=0, bgcolor='black') as disp:
+                  with EasyProcess('xmessage hello'):
+                      img = disp.waitgrab()
+              
+              
+              img.show()
+          #-#
+        
+          
+        Image:
+        
+        ..  #-- screenshot('python -m pyvirtualdisplay.examples.screenshot3','screenshot3.png') --#
+        .. image:: _img/screenshot3.png
+        ..  #-#
+            
+        vncserver
+        ---------
+        
+        ::
+        
+          #-- include('examples/vncserver.py') --#
+          '''
+          Example for Xvnc backend
+          '''
+        
+          from easyprocess import EasyProcess
+          from pyvirtualdisplay.display import Display
+        
+          if __name__ == "__main__":
+              with Display(backend='xvnc', rfbport=5904) as disp:
+                  with EasyProcess('xmessage hello') as proc:
+                      proc.wait()
+          #-#
+        
+        
+        .. _setuptools: http://peak.telecommunity.com/DevCenter/EasyInstall
+        .. _pip: http://pip.openplans.org/
+        .. _Xvfb: http://en.wikipedia.org/wiki/Xvfb
+        .. _Xephyr: http://en.wikipedia.org/wiki/Xephyr
+        .. _pyscreenshot: https://github.com/ponty/pyscreenshot
+        .. _PIL: http://www.pythonware.com/library/pil/
+        .. _Xvnc: http://www.hep.phy.cam.ac.uk/vnc_docs/xvnc.html
+        
+        
+        .. |Travis| image:: http://img.shields.io/travis/ponty/PyVirtualDisplay.svg
+           :target: https://travis-ci.org/ponty/PyVirtualDisplay/
+        .. |Coveralls| image:: http://img.shields.io/coveralls/ponty/PyVirtualDisplay/master.svg
+           :target: https://coveralls.io/r/ponty/PyVirtualDisplay/
+        .. |Latest Version| image:: https://img.shields.io/pypi/v/PyVirtualDisplay.svg
+           :target: https://pypi.python.org/pypi/PyVirtualDisplay/
+        .. |Supported Python versions| image:: https://img.shields.io/pypi/pyversions/PyVirtualDisplay.svg
+           :target: https://pypi.python.org/pypi/PyVirtualDisplay/
+        .. |License| image:: https://img.shields.io/pypi/l/PyVirtualDisplay.svg
+           :target: https://pypi.python.org/pypi/PyVirtualDisplay/
+        .. |Downloads| image:: https://img.shields.io/pypi/dm/PyVirtualDisplay.svg
+           :target: https://pypi.python.org/pypi/PyVirtualDisplay/
+        .. |Code Health| image:: https://landscape.io/github/ponty/PyVirtualDisplay/master/landscape.svg?style=flat
+           :target: https://landscape.io/github/ponty/PyVirtualDisplay/master
+        .. |Documentation| image:: https://readthedocs.org/projects/pyvirtualdisplay/badge/?version=latest
+           :target: http://pyvirtualdisplay.readthedocs.org
+        
+Keywords: Xvfb Xephyr X wrapper
+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/PyVirtualDisplay.egg-info/PKG-INFO b/PyVirtualDisplay.egg-info/PKG-INFO
new file mode 100644
index 0000000..035545f
--- /dev/null
+++ b/PyVirtualDisplay.egg-info/PKG-INFO
@@ -0,0 +1,198 @@
+Metadata-Version: 1.1
+Name: PyVirtualDisplay
+Version: 0.2
+Summary: python wrapper for Xvfb, Xephyr and Xvnc
+Home-page: https://github.com/ponty/pyvirtualdisplay
+Author: ponty
+Author-email: UNKNOWN
+License: BSD
+Description: pyvirtualdisplay is a python wrapper for Xvfb_, Xephyr_ and Xvnc_
+        
+        Links:
+         * home: https://github.com/ponty/pyvirtualdisplay
+         * documentation: http://pyvirtualdisplay.readthedocs.org
+         * PYPI: https://pypi.python.org/pypi/pyvirtualdisplay
+        
+        |Travis| |Coveralls| |Latest Version| |Supported Python versions| |License| |Downloads| |Code Health| |Documentation|
+        
+        Features:
+         - python wrapper
+         - supported python versions: 2.6, 2.7, 3.3, 3.4, 3.5
+         - back-ends: Xvfb_, Xephyr_, Xvnc_
+        
+        .. warning:: at least one back-end should be installed
+        
+        Known problems:
+         - only a few back-end options are supported
+        
+        Possible applications:
+         * GUI testing
+         * automatic GUI screenshot
+        
+        Basic usages
+        ============
+        
+        Start Xephyr::
+        
+            from pyvirtualdisplay import Display
+            xephyr=Display(visible=1, size=(320, 240)).start()
+        
+        Create screenshot of xmessage with Xvfb::
+        
+            from easyprocess import EasyProcess
+            from pyvirtualdisplay.smartdisplay import SmartDisplay
+            with SmartDisplay(visible=0, bgcolor='black') as disp:
+                with EasyProcess('xmessage hello'):
+                    img = disp.waitgrab()
+            img.show()
+        
+        Installation
+        ============
+        
+        General
+        -------
+        
+         * install Xvfb_ or Xephyr_ or Xvnc_.
+         * install pip_
+         * optional: pyscreenshot_ and PIL_ should be installed for ``smartdisplay`` submodule
+         * install the program::
+        
+            # as root
+            pip install pyvirtualdisplay
+        
+        Ubuntu 14.04
+        ------------
+        ::
+        
+            sudo apt-get install python-pip
+            sudo apt-get install xvfb xserver-xephyr vnc4server
+            sudo pip install pyvirtualdisplay
+            # optional
+            sudo apt-get install python-pil scrot
+            sudo pip install pyscreenshot
+            # optional for examples
+            sudo pip install entrypoint2
+        
+        
+        Uninstall
+        ---------
+        
+        ::
+        
+            # as root
+            pip uninstall pyvirtualdisplay
+        
+        
+        Usage
+        =====
+        
+        ..  #-- from docs.screenshot import screenshot--#  
+        ..  #-#
+        
+        GUI Test
+        --------
+        
+        Testing ``gnumeric`` on low resolution::
+        
+          #-- include('examples/lowres.py') --#
+          from easyprocess import EasyProcess
+          from pyvirtualdisplay import Display
+        
+          if __name__ == "__main__":
+              Display(visible=1, size=(320, 240)).start()
+              EasyProcess('gnumeric').start()
+          #-#
+        
+        Image:
+        
+        .. #-- screenshot('python -m pyvirtualdisplay.examples.lowres','lowres.png') --#
+        .. image:: _img/lowres.png
+        .. #-#
+        
+        Screenshot
+        ----------
+        
+        Create screenshot of ``xmessage`` in background::
+        
+          #-- include('examples/screenshot3.py') --#
+          '''
+          using :keyword:`with` statement
+          '''
+          from easyprocess import EasyProcess
+          from pyvirtualdisplay.smartdisplay import SmartDisplay
+        
+          if __name__ == "__main__":
+              with SmartDisplay(visible=0, bgcolor='black') as disp:
+                  with EasyProcess('xmessage hello'):
+                      img = disp.waitgrab()
+              
+              
+              img.show()
+          #-#
+        
+          
+        Image:
+        
+        ..  #-- screenshot('python -m pyvirtualdisplay.examples.screenshot3','screenshot3.png') --#
+        .. image:: _img/screenshot3.png
+        ..  #-#
+            
+        vncserver
+        ---------
+        
+        ::
+        
+          #-- include('examples/vncserver.py') --#
+          '''
+          Example for Xvnc backend
+          '''
+        
+          from easyprocess import EasyProcess
+          from pyvirtualdisplay.display import Display
+        
+          if __name__ == "__main__":
+              with Display(backend='xvnc', rfbport=5904) as disp:
+                  with EasyProcess('xmessage hello') as proc:
+                      proc.wait()
+          #-#
+        
+        
+        .. _setuptools: http://peak.telecommunity.com/DevCenter/EasyInstall
+        .. _pip: http://pip.openplans.org/
+        .. _Xvfb: http://en.wikipedia.org/wiki/Xvfb
+        .. _Xephyr: http://en.wikipedia.org/wiki/Xephyr
+        .. _pyscreenshot: https://github.com/ponty/pyscreenshot
+        .. _PIL: http://www.pythonware.com/library/pil/
+        .. _Xvnc: http://www.hep.phy.cam.ac.uk/vnc_docs/xvnc.html
+        
+        
+        .. |Travis| image:: http://img.shields.io/travis/ponty/PyVirtualDisplay.svg
+           :target: https://travis-ci.org/ponty/PyVirtualDisplay/
+        .. |Coveralls| image:: http://img.shields.io/coveralls/ponty/PyVirtualDisplay/master.svg
+           :target: https://coveralls.io/r/ponty/PyVirtualDisplay/
+        .. |Latest Version| image:: https://img.shields.io/pypi/v/PyVirtualDisplay.svg
+           :target: https://pypi.python.org/pypi/PyVirtualDisplay/
+        .. |Supported Python versions| image:: https://img.shields.io/pypi/pyversions/PyVirtualDisplay.svg
+           :target: https://pypi.python.org/pypi/PyVirtualDisplay/
+        .. |License| image:: https://img.shields.io/pypi/l/PyVirtualDisplay.svg
+           :target: https://pypi.python.org/pypi/PyVirtualDisplay/
+        .. |Downloads| image:: https://img.shields.io/pypi/dm/PyVirtualDisplay.svg
+           :target: https://pypi.python.org/pypi/PyVirtualDisplay/
+        .. |Code Health| image:: https://landscape.io/github/ponty/PyVirtualDisplay/master/landscape.svg?style=flat
+           :target: https://landscape.io/github/ponty/PyVirtualDisplay/master
+        .. |Documentation| image:: https://readthedocs.org/projects/pyvirtualdisplay/badge/?version=latest
+           :target: http://pyvirtualdisplay.readthedocs.org
+        
+Keywords: Xvfb Xephyr X wrapper
+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/PyVirtualDisplay.egg-info/SOURCES.txt b/PyVirtualDisplay.egg-info/SOURCES.txt
new file mode 100644
index 0000000..7d3923b
--- /dev/null
+++ b/PyVirtualDisplay.egg-info/SOURCES.txt
@@ -0,0 +1,33 @@
+LICENSE.txt
+MANIFEST.in
+README.rst
+pavement.py
+requirements.txt
+setup.py
+PyVirtualDisplay.egg-info/PKG-INFO
+PyVirtualDisplay.egg-info/SOURCES.txt
+PyVirtualDisplay.egg-info/dependency_links.txt
+PyVirtualDisplay.egg-info/requires.txt
+PyVirtualDisplay.egg-info/top_level.txt
+docs/.gitignore
+docs/__init__.py
+docs/api.rst
+docs/conf.py
+docs/index.rst
+docs/screenshot.py
+docs/struct.rst
+docs/_img/lowres.png
+docs/_img/screenshot3.png
+pyvirtualdisplay/__init__.py
+pyvirtualdisplay/about.py
+pyvirtualdisplay/abstractdisplay.py
+pyvirtualdisplay/display.py
+pyvirtualdisplay/smartdisplay.py
+pyvirtualdisplay/xephyr.py
+pyvirtualdisplay/xvfb.py
+pyvirtualdisplay/xvnc.py
+pyvirtualdisplay/examples/__init__.py
+pyvirtualdisplay/examples/lowres.py
+pyvirtualdisplay/examples/screenshot1.py
+pyvirtualdisplay/examples/screenshot3.py
+pyvirtualdisplay/examples/vncserver.py
\ No newline at end of file
diff --git a/PyVirtualDisplay.egg-info/dependency_links.txt b/PyVirtualDisplay.egg-info/dependency_links.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/PyVirtualDisplay.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
diff --git a/PyVirtualDisplay.egg-info/requires.txt b/PyVirtualDisplay.egg-info/requires.txt
new file mode 100644
index 0000000..15efc98
--- /dev/null
+++ b/PyVirtualDisplay.egg-info/requires.txt
@@ -0,0 +1 @@
+EasyProcess
diff --git a/PyVirtualDisplay.egg-info/top_level.txt b/PyVirtualDisplay.egg-info/top_level.txt
new file mode 100644
index 0000000..45c7406
--- /dev/null
+++ b/PyVirtualDisplay.egg-info/top_level.txt
@@ -0,0 +1 @@
+pyvirtualdisplay
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..e070815
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,176 @@
+pyvirtualdisplay is a python wrapper for Xvfb_, Xephyr_ and Xvnc_
+
+Links:
+ * home: https://github.com/ponty/pyvirtualdisplay
+ * documentation: http://pyvirtualdisplay.readthedocs.org
+ * PYPI: https://pypi.python.org/pypi/pyvirtualdisplay
+
+|Travis| |Coveralls| |Latest Version| |Supported Python versions| |License| |Downloads| |Code Health| |Documentation|
+
+Features:
+ - python wrapper
+ - supported python versions: 2.6, 2.7, 3.3, 3.4, 3.5
+ - back-ends: Xvfb_, Xephyr_, Xvnc_
+
+.. warning:: at least one back-end should be installed
+
+Known problems:
+ - only a few back-end options are supported
+
+Possible applications:
+ * GUI testing
+ * automatic GUI screenshot
+
+Basic usages
+============
+
+Start Xephyr::
+
+    from pyvirtualdisplay import Display
+    xephyr=Display(visible=1, size=(320, 240)).start()
+
+Create screenshot of xmessage with Xvfb::
+
+    from easyprocess import EasyProcess
+    from pyvirtualdisplay.smartdisplay import SmartDisplay
+    with SmartDisplay(visible=0, bgcolor='black') as disp:
+        with EasyProcess('xmessage hello'):
+            img = disp.waitgrab()
+    img.show()
+
+Installation
+============
+
+General
+-------
+
+ * install Xvfb_ or Xephyr_ or Xvnc_.
+ * install pip_
+ * optional: pyscreenshot_ and PIL_ should be installed for ``smartdisplay`` submodule
+ * install the program::
+
+    # as root
+    pip install pyvirtualdisplay
+
+Ubuntu 14.04
+------------
+::
+
+    sudo apt-get install python-pip
+    sudo apt-get install xvfb xserver-xephyr vnc4server
+    sudo pip install pyvirtualdisplay
+    # optional
+    sudo apt-get install python-pil scrot
+    sudo pip install pyscreenshot
+    # optional for examples
+    sudo pip install entrypoint2
+
+
+Uninstall
+---------
+
+::
+
+    # as root
+    pip uninstall pyvirtualdisplay
+
+
+Usage
+=====
+
+..  #-- from docs.screenshot import screenshot--#  
+..  #-#
+
+GUI Test
+--------
+
+Testing ``gnumeric`` on low resolution::
+
+  #-- include('examples/lowres.py') --#
+  from easyprocess import EasyProcess
+  from pyvirtualdisplay import Display
+
+  if __name__ == "__main__":
+      Display(visible=1, size=(320, 240)).start()
+      EasyProcess('gnumeric').start()
+  #-#
+
+Image:
+
+.. #-- screenshot('python -m pyvirtualdisplay.examples.lowres','lowres.png') --#
+.. image:: _img/lowres.png
+.. #-#
+
+Screenshot
+----------
+
+Create screenshot of ``xmessage`` in background::
+
+  #-- include('examples/screenshot3.py') --#
+  '''
+  using :keyword:`with` statement
+  '''
+  from easyprocess import EasyProcess
+  from pyvirtualdisplay.smartdisplay import SmartDisplay
+
+  if __name__ == "__main__":
+      with SmartDisplay(visible=0, bgcolor='black') as disp:
+          with EasyProcess('xmessage hello'):
+              img = disp.waitgrab()
+      
+      
+      img.show()
+  #-#
+
+  
+Image:
+
+..  #-- screenshot('python -m pyvirtualdisplay.examples.screenshot3','screenshot3.png') --#
+.. image:: _img/screenshot3.png
+..  #-#
+    
+vncserver
+---------
+
+::
+
+  #-- include('examples/vncserver.py') --#
+  '''
+  Example for Xvnc backend
+  '''
+
+  from easyprocess import EasyProcess
+  from pyvirtualdisplay.display import Display
+
+  if __name__ == "__main__":
+      with Display(backend='xvnc', rfbport=5904) as disp:
+          with EasyProcess('xmessage hello') as proc:
+              proc.wait()
+  #-#
+
+
+.. _setuptools: http://peak.telecommunity.com/DevCenter/EasyInstall
+.. _pip: http://pip.openplans.org/
+.. _Xvfb: http://en.wikipedia.org/wiki/Xvfb
+.. _Xephyr: http://en.wikipedia.org/wiki/Xephyr
+.. _pyscreenshot: https://github.com/ponty/pyscreenshot
+.. _PIL: http://www.pythonware.com/library/pil/
+.. _Xvnc: http://www.hep.phy.cam.ac.uk/vnc_docs/xvnc.html
+
+
+.. |Travis| image:: http://img.shields.io/travis/ponty/PyVirtualDisplay.svg
+   :target: https://travis-ci.org/ponty/PyVirtualDisplay/
+.. |Coveralls| image:: http://img.shields.io/coveralls/ponty/PyVirtualDisplay/master.svg
+   :target: https://coveralls.io/r/ponty/PyVirtualDisplay/
+.. |Latest Version| image:: https://img.shields.io/pypi/v/PyVirtualDisplay.svg
+   :target: https://pypi.python.org/pypi/PyVirtualDisplay/
+.. |Supported Python versions| image:: https://img.shields.io/pypi/pyversions/PyVirtualDisplay.svg
+   :target: https://pypi.python.org/pypi/PyVirtualDisplay/
+.. |License| image:: https://img.shields.io/pypi/l/PyVirtualDisplay.svg
+   :target: https://pypi.python.org/pypi/PyVirtualDisplay/
+.. |Downloads| image:: https://img.shields.io/pypi/dm/PyVirtualDisplay.svg
+   :target: https://pypi.python.org/pypi/PyVirtualDisplay/
+.. |Code Health| image:: https://landscape.io/github/ponty/PyVirtualDisplay/master/landscape.svg?style=flat
+   :target: https://landscape.io/github/ponty/PyVirtualDisplay/master
+.. |Documentation| image:: https://readthedocs.org/projects/pyvirtualdisplay/badge/?version=latest
+   :target: http://pyvirtualdisplay.readthedocs.org
diff --git a/docs/.gitignore b/docs/.gitignore
new file mode 100644
index 0000000..eedd89b
--- /dev/null
+++ b/docs/.gitignore
@@ -0,0 +1 @@
+api
diff --git a/docs/__init__.py b/docs/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/docs/_img/lowres.png b/docs/_img/lowres.png
new file mode 100644
index 0000000..bb28356
Binary files /dev/null and b/docs/_img/lowres.png differ
diff --git a/docs/_img/screenshot3.png b/docs/_img/screenshot3.png
new file mode 100644
index 0000000..ab7579e
Binary files /dev/null and b/docs/_img/screenshot3.png differ
diff --git a/docs/api.rst b/docs/api.rst
new file mode 100644
index 0000000..d495b51
--- /dev/null
+++ b/docs/api.rst
@@ -0,0 +1,14 @@
+API
+===
+
+.. autoclass:: pyvirtualdisplay.Display
+    :members: start, stop
+
+.. autoclass:: pyvirtualdisplay.smartdisplay.SmartDisplay
+    :members:
+    :undoc-members:
+
+
+
+
+
diff --git a/docs/conf.py b/docs/conf.py
new file mode 100644
index 0000000..b29c350
--- /dev/null
+++ b/docs/conf.py
@@ -0,0 +1,55 @@
+import sys
+import os
+
+project = 'PyVirtualDisplay'
+author = 'ponty'
+copyright = '2011, ponty'
+
+__version__ = None
+exec(open(os.path.join('..', project.lower(), 'about.py')).read())
+release = __version__
+
+sys.path.insert(0, os.path.abspath('..'))
+
+
+# Extension
+extensions = [
+    # -*-Extensions: -*-
+    'sphinx.ext.autodoc',
+#     'sphinxcontrib.programoutput',
+#     'sphinxcontrib.programscreenshot',
+    'sphinx.ext.graphviz',
+    #'sphinx.ext.autosummary',
+    'sphinx.ext.intersphinx',
+]
+intersphinx_mapping = {'python': ('http://docs.python.org/', None)}
+
+# Source
+master_doc = 'index'
+templates_path = ['_templates']
+source_suffix = '.rst'
+exclude_trees = []
+pygments_style = 'sphinx'
+
+# html build settings
+html_theme = 'default'
+html_static_path = ['_static']
+
+# htmlhelp settings
+htmlhelp_basename = '%sdoc' % project
+
+# latex build settings
+latex_documents = [
+    ('index', '%s.tex' % project, u'%s Documentation' % project,
+     author, 'manual'),
+]
+
+
+# remove blank pages from pdf
+# http://groups.google.com/group/sphinx-
+# dev/browse_thread/thread/92e19267d095412d/d60dcba483c6b13d
+latex_font_size = '10pt,oneside'
+
+latex_elements = dict(
+    papersize='a4paper',
+)
diff --git a/docs/index.rst b/docs/index.rst
new file mode 100644
index 0000000..f492e8c
--- /dev/null
+++ b/docs/index.rst
@@ -0,0 +1,17 @@
+================
+PyVirtualDisplay
+================
+
+
+About
+=====
+
+
+.. include:: ../README.rst
+
+.. include:: struct.rst
+
+.. include:: api.rst
+
+
+
diff --git a/docs/screenshot.py b/docs/screenshot.py
new file mode 100644
index 0000000..5315cde
--- /dev/null
+++ b/docs/screenshot.py
@@ -0,0 +1,19 @@
+from easyprocess import EasyProcess
+import os
+from pyvirtualdisplay.smartdisplay import SmartDisplay
+import cog
+
+import logging
+FORMAT = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
+logging.basicConfig(level=logging.DEBUG, format=FORMAT)
+
+def screenshot(cmd, fname):
+    logging.info('%s %s',cmd, fname)
+    fpath = 'docs/_img/%s' % fname
+    if os.path.exists(fpath):
+        os.remove(fpath)
+    with SmartDisplay(visible=0, bgcolor='black') as disp:
+        with EasyProcess(cmd):
+            img = disp.waitgrab()
+            img.save(fpath)
+            cog.outl('.. image:: _img/%s' % fname)
diff --git a/docs/struct.rst b/docs/struct.rst
new file mode 100644
index 0000000..47daca8
--- /dev/null
+++ b/docs/struct.rst
@@ -0,0 +1,38 @@
+Hierarchy
+==================================
+
+.. graphviz::
+
+    digraph G {
+    rankdir=LR;
+    node [fontsize=8,style=filled, fillcolor=white];
+    fontsize=8;
+
+    subgraph cluster_0 {
+        label = "pyvirtualdisplay";
+        style=filled;
+        subgraph cluster_2 {
+            style=filled;
+            fillcolor=white;
+            label = "wrappers";
+
+            XvfbDisplay;
+            XephyrDisplay;
+            XvncDisplay;
+        }
+        Display -> XvfbDisplay;
+        Display -> XephyrDisplay;
+        Display -> XvncDisplay;
+        SmartDisplay -> Display
+    }
+    XvfbDisplay -> Xvfb;
+    XephyrDisplay -> Xephyr;
+    XvncDisplay -> Xvnc;
+
+    application -> Display;
+    application -> SmartDisplay;
+
+	SmartDisplay -> pyscreenshot;
+	SmartDisplay -> PIL;
+	
+    }
diff --git a/pavement.py b/pavement.py
new file mode 100644
index 0000000..f4a26a4
--- /dev/null
+++ b/pavement.py
@@ -0,0 +1,25 @@
+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
+
+
+IMPORTS=[cog, html, setup]
+    
+options(
+    cog=Bunch(
+        basedir='.',
+        pattern='README.rst',
+        includedir='pyvirtualdisplay',
+        beginspec='#--',
+        endspec='--#',
+        endoutput='#-#',
+    )
+)
+
+
+# get info from setup.py
+setup_py = ''.join(
+    [x for x in Path('setup.py').lines() if 'setuptools' not in x])
+exec(setup_py)
\ No newline at end of file
diff --git a/pyvirtualdisplay/__init__.py b/pyvirtualdisplay/__init__.py
new file mode 100644
index 0000000..9d2e84d
--- /dev/null
+++ b/pyvirtualdisplay/__init__.py
@@ -0,0 +1,10 @@
+import logging
+
+from pyvirtualdisplay.display import Display
+from pyvirtualdisplay.about import __version__
+
+
+log = logging.getLogger(__name__)
+
+log = logging.getLogger(__name__)
+log.debug('version=%s', __version__)
diff --git a/pyvirtualdisplay/about.py b/pyvirtualdisplay/about.py
new file mode 100644
index 0000000..b650ceb
--- /dev/null
+++ b/pyvirtualdisplay/about.py
@@ -0,0 +1 @@
+__version__ = '0.2'
diff --git a/pyvirtualdisplay/abstractdisplay.py b/pyvirtualdisplay/abstractdisplay.py
new file mode 100644
index 0000000..1c91ab8
--- /dev/null
+++ b/pyvirtualdisplay/abstractdisplay.py
@@ -0,0 +1,111 @@
+from easyprocess import EasyProcess
+import fnmatch
+import logging
+import os
+import time
+from threading import Lock
+
+mutex = Lock()
... 582 lines suppressed ...

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



More information about the Python-modules-commits mailing list