Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/devbot/xvfb.py
diff options
context:
space:
mode:
Diffstat (limited to 'devbot/xvfb.py')
-rw-r--r--devbot/xvfb.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/devbot/xvfb.py b/devbot/xvfb.py
index adc72f0..41110f7 100644
--- a/devbot/xvfb.py
+++ b/devbot/xvfb.py
@@ -3,14 +3,16 @@ import subprocess
from devbot import utils
+
def _find_free_display():
- for i in range (100, 1000):
+ for i in range(100, 1000):
display = ":%s" % i
result = subprocess.call(args=["xdpyinfo", "--display", display],
stdout=utils.devnull,
stderr=subprocess.STDOUT)
if result > 0:
- return display
+ return display
+
def start():
xvfb_display = _find_free_display()
@@ -22,6 +24,7 @@ def start():
return (xvfb_proc, orig_display)
+
def stop(xvfb_proc, orig_display):
if orig_display is not None:
os.environ["DISPLAY"] = orig_display