Beispiel #1
0
    def _check_processes(self):
        self.is_checking = True
        self.check_id = None
        logger.info('Checking pulseaudio processes ...')

        procs = PulseAudioFinder.get_processes()
        for proc in procs:
            if proc not in self.processes:
                logger.info('Adding pulseaudio process ({})'.format(proc.pid))
                self.processes.append(proc)

        gone, alive = psutil.wait_procs(self.processes, timeout=2)
        for proc in gone:
            if proc.is_attached:
                proc.detach()
            logger.info('Removing pulseaudio process ({})'.format(proc.pid))
            self.processes.remove(proc)
        for proc in alive:
            if not proc.is_attached and not proc.disabled:
                proc.attach()

        self.is_checking = False
        return False
Beispiel #2
0
    def _check_processes(self):
        self.is_checking = True
        self.check_id = None
        logger.info('Checking pulseaudio processes ...')

        procs = PulseAudioFinder.get_processes()
        for proc in procs:
            if proc not in self.processes:
                logger.info('Adding pulseaudio process ({})'.format(proc.pid))
                self.processes.append(proc)

        gone, alive = psutil.wait_procs(self.processes, timeout=2)
        for proc in gone:
            if proc.is_attached:
                proc.detach()
            logger.info('Removing pulseaudio process ({})'.format(proc.pid))
            self.processes.remove(proc)
        for proc in alive:
            if not proc.is_attached and not proc.disabled:
                proc.attach()

        self.is_checking = False
        return False