Browse Source

Adding nolisten

changes/49/376949/1
Miljan Karadzic 8 years ago
parent
commit
ffa44e576d
  1. 7
      xvfbwrapper/xvfbwrapper.py

7
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))

Loading…
Cancel
Save