Exemplo n.º 1
0
    def setup(self, data):
        """Construct all the objects required to implement this interface.

        This method must be provided by all subclasses.
        """
        # Finish all initialization jobs.
        # FIXME: Control the initialization via DBus.
        self._print_message("Waiting for all threads to finish...")
        threadMgr.wait_all()

        # Verify the payload type.
        # FIXME: This is a temporary check.
        if self.payload.type == PAYLOAD_TYPE_DNF:
            raise ValueError("The DNF payload is not supported yet!")
Exemplo n.º 2
0
    def _wait_for_threads_to_finish(self):
        """Wait for background processing threads to finish.

        Wait for background processing threads to finish before filling
        the installation task queue. Otherwise installation tasks might
        be created based on old data in DBus modules, missing data set by
        the threads that are still running.
        """

        # This should be the only thread running, wait for the others to finish if not.
        if threadMgr.running > 1:
            # show a progress message
            progressQ.send_message(
                _("Waiting for %s threads to finish") %
                (threadMgr.running - 1))
            for message in ("Thread %s is running" % n
                            for n in threadMgr.names):
                log.debug(message)
            threadMgr.wait_all()
            log.debug(
                "No more threads are running, assembling installation task queue."
            )
Exemplo n.º 3
0
 def wait_for_all_treads():
     for message in ("Thread %s is running" % n
                     for n in threadMgr.names):
         log.debug(message)
     threadMgr.wait_all()
Exemplo n.º 4
0
 def wait_for_all_treads():
     for message in ("Thread %s is running" % n for n in threadMgr.names):
         log.debug(message)
     threadMgr.wait_all()