diff options
Diffstat (limited to 'devbot/xvfb.py')
-rw-r--r-- | devbot/xvfb.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/devbot/xvfb.py b/devbot/xvfb.py index 41110f7..35da3ac 100644 --- a/devbot/xvfb.py +++ b/devbot/xvfb.py @@ -4,16 +4,6 @@ import subprocess from devbot import utils -def _find_free_display(): - 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 - - def start(): xvfb_display = _find_free_display() xvfb_proc = subprocess.Popen(args=["Xvfb", xvfb_display], @@ -30,3 +20,13 @@ def stop(xvfb_proc, orig_display): os.environ["DISPLAY"] = orig_display xvfb_proc.terminate() + + +def _find_free_display(): + 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 |