modified README

This commit is contained in:
Corey Goldberg 2015-09-20 11:35:22 -04:00
parent 3841f2b74d
commit c8a2f03c2d
2 changed files with 28 additions and 13 deletions

View File

@ -2,12 +2,12 @@
xvfbwrapper xvfbwrapper
=============== ===============
Python wrapper for running a display inside X virtual framebuffer (Xvfb) Python wrapper for running a display inside X virtual framebuffer (Xvfb). This is useful for running acceptance tests (i.e. browser-based tests) on a headless server.
* Dev: https://github.com/cgoldberg/xvfbwrapper * Dev: https://github.com/cgoldberg/xvfbwrapper
* PyPI: http://pypi.python.org/pypi/xvfbwrapper * PyPI: http://pypi.python.org/pypi/xvfbwrapper
Corey Goldberg - 2012, 2013 Corey Goldberg - 2012, 2013, 2015
**** ****
@ -16,7 +16,7 @@ Corey Goldberg - 2012, 2013
********* *********
Install xvfbwrapper from PyPI:: Install xvfbwrapper from PyPI::
pip install xvfbwrapper pip install xvfbwrapper
*********************** ***********************
@ -24,7 +24,7 @@ Install xvfbwrapper from PyPI::
*********************** ***********************
* Xvfb (`sudo apt-get install xvfb`, or similar) * Xvfb (`sudo apt-get install xvfb`, or similar)
* Python 2.7 or 3.2+ (tested on py27, py32, py33) * Python 2.7 or 3.2+ (tested on py27, py32, py33, py34, pypy)
************************************** **************************************
About Xvfb (X Virtual Framebuffer) About Xvfb (X Virtual Framebuffer)
@ -37,13 +37,28 @@ In the X Window System, Xvfb or X Virtual FrameBuffer is an X11 server that perf
************************ ************************
:: ::
from xvfbwrapper import Xvfb from xvfbwrapper import Xvfb
vdisplay = Xvfb() vdisplay = Xvfb()
vdisplay.start() vdisplay.start()
# launch stuff inside virtual display here # launch stuff inside virtual display here.
vdisplay.stop()
****************************************************************************
Example: Basic Usage, using a specified display geometry and color depth
****************************************************************************
::
from xvfbwrapper import Xvfb
vdisplay = Xvfb(width=1024, height=768, colordepth=16)
vdisplay.start()
# launch stuff inside virtual display here.
vdisplay.stop() vdisplay.stop()
@ -52,9 +67,9 @@ In the X Window System, Xvfb or X Virtual FrameBuffer is an X11 server that perf
*************************************** ***************************************
:: ::
from xvfbwrapper import Xvfb from xvfbwrapper import Xvfb
with Xvfb() as xvfb: with Xvfb() as xvfb:
# launch stuff inside virtual display here. # launch stuff inside virtual display here.
# It starts/stops in this code block. # It starts/stops in this code block.
@ -66,11 +81,11 @@ In the X Window System, Xvfb or X Virtual FrameBuffer is an X11 server that perf
:: ::
import unittest
from selenium import webdriver from selenium import webdriver
from xvfbwrapper import Xvfb from xvfbwrapper import Xvfb
import unittest
class TestPages(unittest.TestCase): class TestPages(unittest.TestCase):

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python #!/usr/bin/env python
# #
# * Corey Goldberg, 2012, 2013 # * Corey Goldberg, 2012, 2013, 2015
# #
# * inspired by: # * inspired by:
# PyVirtualDisplay: http://pypi.python.org/pypi/PyVirtualDisplay # PyVirtualDisplay: http://pypi.python.org/pypi/PyVirtualDisplay