/usr/lib/python2.7/dist-packages/pyvirtualdisplay/xephyr.py is in python-pyvirtualdisplay 0.2.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | from easyprocess import EasyProcess
from pyvirtualdisplay.abstractdisplay import AbstractDisplay
PROGRAM = 'Xephyr'
URL = None
PACKAGE = 'xephyr'
class XephyrDisplay(AbstractDisplay):
'''
Xephyr wrapper
Xephyr is an X server outputting to a window on a pre-existing X display
'''
def __init__(self, size=(1024, 768), color_depth=24, bgcolor='black'):
'''
:param bgcolor: 'black' or 'white'
'''
self.color_depth = color_depth
self.size = size
self.bgcolor = bgcolor
self.screen = 0
self.process = None
self.display = None
AbstractDisplay.__init__(self)
@classmethod
def check_installed(cls):
EasyProcess([PROGRAM, '-help'], url=URL,
ubuntu_package=PACKAGE).check_installed()
@property
def _cmd(self):
cmd = [PROGRAM,
dict(black='-br', white='-wr')[self.bgcolor],
'-screen',
'x'.join(map(str, list(self.size) + [self.color_depth])),
self.new_display_var,
]
return cmd
|