-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
titi
committed
Feb 11, 2011
0 parents
commit 9c7b92f
Showing
25 changed files
with
622 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Release 0.0.0 (2/10/2011) | ||
================================ | ||
|
||
* First release. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
include *.txt | ||
include *.rst | ||
include setup.py | ||
include setup.cfg | ||
include pavement.py | ||
include paver-minilib.zip | ||
include bootstrap.py | ||
|
||
recursive-include docs * | ||
prune docs/_build | ||
|
||
include .version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
PyVirtualDisplay is a python wrapper for Xvfb_ and Xephyr_ | ||
|
||
home: https://github.com/ponty/PyVirtualDisplay | ||
|
||
documentation: http://ponty.github.com/PyVirtualDisplay | ||
|
||
Possible applications: | ||
* GUI testing | ||
* automatic GUI screenshot | ||
|
||
Basic usage | ||
============ | ||
|
||
:: | ||
|
||
from pyvirtualdisplay import Display | ||
# Start Xephyr | ||
disp1=Display(visible=1, size=(320, 240)).start() | ||
|
||
|
||
Installation | ||
============ | ||
|
||
General | ||
-------- | ||
|
||
The easiest way to get abandi is if you have setuptools_ installed:: | ||
|
||
# as root | ||
easy_install PyVirtualDisplay | ||
|
||
or if you have pip_ installed:: | ||
|
||
# as root | ||
pip install PyVirtualDisplay | ||
|
||
Uninstall:: | ||
|
||
# as root | ||
pip uninstall PyVirtualDisplay | ||
|
||
Ubuntu | ||
---------- | ||
:: | ||
|
||
sudo apt-get install python-setuptools | ||
sudo apt-get install xvfb | ||
sudo apt-get install xephyr | ||
sudo easy_install PyVirtualDisplay | ||
|
||
|
||
.. _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 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
API | ||
=== | ||
|
||
.. autofunction:: pyvirtualdisplay.Display |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
:tocdepth: 1 | ||
|
||
.. _changes: | ||
|
||
Changes | ||
***************** | ||
|
||
.. include:: ../CHANGES.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from path import path | ||
import logging | ||
import sphinx | ||
import sys | ||
|
||
project='PyVirtualDisplay' | ||
author='ponty' | ||
copyright = '2011, ponty' | ||
|
||
sys.path.insert(0, (path(__file__).dirname().dirname() ).abspath()) | ||
from pyvirtualdisplay import __version__ | ||
release = __version__ | ||
|
||
#logging.basicConfig(level=logging.DEBUG) | ||
|
||
# Extension | ||
extensions = [ | ||
# -*-Extensions: -*- | ||
'sphinx.ext.autodoc', | ||
'sphinxcontrib.programoutput', | ||
'sphinxcontrib.programscreenshot', | ||
'sphinx.ext.graphviz', | ||
#'sphinx.ext.autosummary', | ||
] | ||
intersphinx_mapping = {'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'), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Python wrapper for Xvfb_ and Xephyr_ | ||
|
||
Contents: | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
readme | ||
usage | ||
api | ||
struct | ||
changes | ||
|
||
Indices and tables | ||
================== | ||
|
||
* :ref:`genindex` | ||
* :ref:`modindex` | ||
* :ref:`search` | ||
|
||
.. _Xvfb: http://en.wikipedia.org/wiki/Xvfb | ||
.. _Xephyr: http://en.wikipedia.org/wiki/Xephyr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
About | ||
====== | ||
|
||
|
||
.. include:: ../README.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Structure | ||
================================== | ||
|
||
.. 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; | ||
} | ||
Display -> XvfbDisplay; | ||
Display -> XephyrDisplay; | ||
} | ||
XvfbDisplay -> Xvfb; | ||
XephyrDisplay -> Xephyr; | ||
|
||
application -> Display; | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
Usage | ||
================== | ||
|
||
GUI Test | ||
---------- | ||
|
||
Testing ``abiword`` on low resolution: | ||
|
||
.. literalinclude:: ../pyvirtualdisplay/examples/lowres.py | ||
|
||
.. program-screenshot:: python -m pyvirtualdisplay.examples.lowres | ||
:prompt: | ||
:wait: 3 | ||
|
||
|
||
Screenshot | ||
----------- | ||
|
||
Create screenshot of ``xmessage`` in background, | ||
pyscreenshot_ and PIL_ should be installed: | ||
|
||
.. literalinclude:: ../pyvirtualdisplay/examples/screenshot.py | ||
|
||
.. program-screenshot:: python -m pyvirtualdisplay.examples.screenshot | ||
:prompt: | ||
|
||
|
||
The same with wrap() function: | ||
|
||
.. literalinclude:: ../pyvirtualdisplay/examples/screenshot2.py | ||
|
||
.. program-screenshot:: python -m pyvirtualdisplay.examples.screenshot2 | ||
:prompt: | ||
|
||
|
||
.. _pyscreenshot: https://github.com/ponty/pyscreenshot | ||
.. _PIL: http://www.pythonware.com/library/pil/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
# -*- Import: -*- | ||
from paver.easy import * | ||
from paver.setuputils import setup | ||
from setuptools import find_packages | ||
|
||
try: | ||
# Optional tasks, only needed for development | ||
# -*- Optional import: -*- | ||
import paver.doctools | ||
import paver.virtual | ||
import paver.misctasks | ||
ALL_TASKS_LOADED = True | ||
except ImportError, e: | ||
info("some tasks could not not be imported.") | ||
debug(str(e)) | ||
ALL_TASKS_LOADED = False | ||
|
||
NAME = 'PyVirtualDisplay' | ||
PACKAGE = 'pyvirtualdisplay' | ||
URL = 'https://github.com/ponty/pyvirtualdisplay' | ||
DESCRIPTION = '???' | ||
|
||
try: | ||
sys.path.insert(0, path('.').abspath()) | ||
version = None | ||
exec 'from %s import __version__; version = __version__' % PACKAGE | ||
open('.version', 'w').write(version) | ||
except ImportError, e: | ||
version = open('.version', 'r').read() | ||
|
||
classifiers = [ | ||
# Get more strings from http://www.python.org/pypi?%3Aaction=list_classifiers | ||
"License :: OSI Approved :: BSD License", | ||
"Natural Language :: English", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python", | ||
] | ||
|
||
install_requires = [ | ||
# -*- Install requires: -*- | ||
'setuptools', | ||
'path.py', | ||
'EasyProcess', | ||
] | ||
|
||
entry_points = """ | ||
# -*- Entry points: -*- | ||
""" | ||
|
||
# compatible with distutils of python 2.3+ or later | ||
setup( | ||
name=NAME, | ||
version=version, | ||
description=DESCRIPTION, | ||
long_description=open('README.rst', 'r').read(), | ||
classifiers=classifiers, | ||
keywords='Xvfb Xephyr X wrapper', | ||
author='ponty', | ||
#author_email='[email protected]', | ||
url=URL, | ||
license='BSD', | ||
packages=find_packages(exclude=['bootstrap', 'pavement', ]), | ||
include_package_data=True, | ||
test_suite='nose.collector', | ||
zip_safe=False, | ||
install_requires=install_requires, | ||
entry_points=entry_points, | ||
) | ||
|
||
options( | ||
# -*- Paver options: -*- | ||
minilib=Bunch( | ||
extra_files=[ | ||
# -*- Minilib extra files: -*- | ||
] | ||
), | ||
sphinx=Bunch( | ||
docroot='docs', | ||
builddir="_build", | ||
sourcedir="" | ||
), | ||
virtualenv=Bunch( | ||
packages_to_install=[ | ||
# -*- Virtualenv packages to install: -*- | ||
"nose", | ||
"Sphinx>=0.6b1", | ||
"pkginfo", | ||
"virtualenv"], | ||
dest_dir='./virtual-env/', | ||
install_paver=True, | ||
script_name='bootstrap.py', | ||
paver_command_line=None | ||
), | ||
) | ||
|
||
options.setup.package_data = paver.setuputils.find_package_data( | ||
PACKAGE, package=PACKAGE, only_in_packages=False) | ||
|
||
if ALL_TASKS_LOADED: | ||
@task | ||
@needs('generate_setup', 'minilib', 'setuptools.command.sdist') | ||
def sdist(): | ||
"""Overrides sdist to make sure that our setup.py is generated.""" | ||
|
||
@task | ||
def pychecker(): | ||
sh('pychecker --stdlib --only --limit 100 {package}/ '.format(package=PACKAGE)) | ||
|
||
@task | ||
def findimports(): | ||
'''list external imports''' | ||
sh('findimports {package} |grep -v ":"|grep -v {package}|sort|uniq'.format(package=PACKAGE)) | ||
|
||
@task | ||
def pyflakes(): | ||
sh('pyflakes {package}' + PACKAGE) | ||
|
||
|
||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from display import Display | ||
|
||
__version__='0.0.0' |
Oops, something went wrong.