From ffa44e576d3e6704adfb698afa307d069f3347f3 Mon Sep 17 00:00:00 2001 From: Miljan Karadzic Date: Sun, 12 May 2013 22:46:01 +0200 Subject: [PATCH] Adding nolisten --- xvfbwrapper/xvfbwrapper.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xvfbwrapper/xvfbwrapper.py b/xvfbwrapper/xvfbwrapper.py index 61c6849..35b05e7 100644 --- a/xvfbwrapper/xvfbwrapper.py +++ b/xvfbwrapper/xvfbwrapper.py @@ -18,10 +18,11 @@ import time class Xvfb: - def __init__(self, width=800, height=680, colordepth=24): + def __init__(self, width=800, height=680, colordepth=24, nolisten=None): self.width = width self.height = height self.colordepth = colordepth + self.nolisten = nolisten self.proc = None if 'DISPLAY' in os.environ: @@ -35,6 +36,10 @@ class Xvfb: 'Xvfb', ':%d' % (self.vdisplay_num,), '-screen', '0', '%dx%dx%d' % (self.width, self.height, self.colordepth) ] + + if self.nolisten: + self.xvfb_cmd = self.xvfb_cmd + ['-nolisten', self.nolisten] + self.proc = subprocess.Popen(self.xvfb_cmd, stdout=open(os.devnull), stderr=open(os.devnull))