示例#1
0
    def __init__(self, use_xauth=False, check_startup=False, randomizer=None):
        with mutex:
            self.display = self.search_for_display(randomizer=randomizer)
            while self.display in USED_DISPLAY_NR_LIST:
                self.display += 1

            USED_DISPLAY_NR_LIST.append(self.display)

        if use_xauth and not xauth.is_installed():
            raise xauth.NotFoundError()

        self.use_xauth = use_xauth
        self._old_xauth = None
        self._xauth_filename = None
        self.check_startup = check_startup
        if check_startup and not fcntl:
            self.check_startup = False
            log.warning(
                "fcntl module can't be imported, 'check_startup' parameter has been disabled"
            )
            log.warning("fnctl module does not exist on Windows")
        if self.check_startup:
            rp, wp = os.pipe()
            fcntl.fcntl(rp, fcntl.F_SETFD, fcntl.FD_CLOEXEC)
            # to properly allow to inherit fds to subprocess on
            # python 3.2+ the easyprocess needs small fix..
            fcntl.fcntl(wp, fcntl.F_SETFD, 0)
            self.check_startup_fd = wp
            self._check_startup_fd = rp
        EasyProcess.__init__(self, self._cmd)
 def __init__(self):
     mutex.acquire()
     try:
         self.display = self.search_for_display()
         while self.display in USED_DISPLAY_NR_LIST:
             self.display += 1
         USED_DISPLAY_NR_LIST.append(self.display)
     finally:
         mutex.release()
     EasyProcess.__init__(self, self._cmd)
示例#3
0
 def __init__(self):
     mutex.acquire()
     try:        
         self.display = self.search_for_display()
         while self.display in USED_DISPLAY_NR_LIST:
             self.display+=1            
         USED_DISPLAY_NR_LIST.append(self.display)
     finally:
         mutex.release()
     EasyProcess.__init__(self, self._cmd)
示例#4
0
 def __init__(self, use_xauth=False):
     mutex.acquire()
     try:
         self.display = self.search_for_display()
         while self.display in USED_DISPLAY_NR_LIST:
             self.display+=1
         USED_DISPLAY_NR_LIST.append(self.display)
     finally:
         mutex.release()
     if use_xauth and not xauth.is_installed():
         raise xauth.NotFoundError()
     self.use_xauth = use_xauth
     self._old_xauth = None
     self._xauth_filename = None
     EasyProcess.__init__(self, self._cmd)
示例#5
0
 def start(self):
     '''
     start display
     
     :rtype: self
     '''
     self.display = self.search_for_display()
     EasyProcess.__init__(self, self._cmd)
     EasyProcess.start(self)
     
     # https://github.com/ponty/PyVirtualDisplay/issues/2
     self.old_display_var = os.environ['DISPLAY'] if 'DISPLAY' in os.environ else ':0'
     
     self.redirect_display(True)
     # wait until X server is active
     # TODO: better method
     time.sleep(0.1)
     return self
示例#6
0
    def start(self):
        '''
        start display
        
        :rtype: self
        '''
        self.display = self.search_for_display()
        EasyProcess.__init__(self, self._cmd)
        EasyProcess.start(self)

        # https://github.com/ponty/PyVirtualDisplay/issues/2
        self.old_display_var = os.environ[
            'DISPLAY'] if 'DISPLAY' in os.environ else ':0'

        self.redirect_display(True)
        # wait until X server is active
        # TODO: better method
        time.sleep(0.1)
        return self
 def __init__(self):
     self.display = self.search_for_display()
     EasyProcess.__init__(self, self._cmd)
 def __init__(self):
     self.display = self.search_for_display()
     EasyProcess.__init__(self, self._cmd)