def __init__(self, program, use_xauth, randomizer, retries, extra_args): self.extra_args = extra_args self.retries = retries self.program = program self.randomizer = randomizer self.stdout = None self.stderr = None self.old_display_var = None self.subproc = None self.is_started = False helptext = get_helptext(program) self.has_displayfd = "-displayfd" in helptext if not self.has_displayfd: log.debug("-displayfd flag is missing.") # if check_startup and not has_displayfd: # check_startup = False # log.warning( # program # + " -displayfd flag is not supported, 'check_startup' parameter has been disabled" # ) self._check_flags(helptext) if use_xauth and not xauth.is_installed(): raise xauth.NotFoundError() self.use_xauth = use_xauth self._old_xauth = None self._xauth_filename = None
def __init__(self, program, use_xauth, retries, extra_args, manage_global_env): self._extra_args = extra_args self._retries = retries self._program = program self.stdout = None self.stderr = None self.old_display_var = None self._subproc = None self.display = None self._is_started = False self._manage_global_env = manage_global_env self._reset_global_env = False self._pipe_wfd = None self._retries_current = 0 helptext = get_helptext(program) self._has_displayfd = "-displayfd" in helptext if not self._has_displayfd: log.debug("-displayfd flag is missing.") PYVIRTUALDISPLAY_DISPLAYFD = os.environ.get( "PYVIRTUALDISPLAY_DISPLAYFD") if PYVIRTUALDISPLAY_DISPLAYFD: log.debug("PYVIRTUALDISPLAY_DISPLAYFD=%s", PYVIRTUALDISPLAY_DISPLAYFD) # '0'->false, '1'->true self._has_displayfd = bool(int(PYVIRTUALDISPLAY_DISPLAYFD)) else: # TODO: macos: displayfd is available on XQuartz-2.7.11 but it doesn't work, always 0 is returned if platform_is_osx(): self._has_displayfd = False self._check_flags(helptext) if use_xauth and not xauth.is_installed(): raise xauth.NotFoundError() self._use_xauth = use_xauth self._old_xauth = None self._xauth_filename = None
def has_displayfd(): return "-displayfd" in get_helptext("Xvfb")