Пример #1
0
    def action_failed(self, signal_content):
        utils.set_running_lock(False)
        self.update_signal([("action-failed", signal_content)])

        self.exit_manager.check()
        if signal_content[1] == ACTION_UPGRADE:
            self.is_upgrading = False
Пример #2
0
 def action_failed(self, signal_content):
     utils.set_running_lock(False)
     self.update_signal([("action-failed", signal_content)])
     
     self.exit_manager.check()
     if signal_content[1] == ACTION_UPGRADE:
         self.is_upgrading = False
Пример #3
0
    def download_failed(self, pkg_name, action_type, e):
        logger.error("%s download failed with %s" % (pkg_name, e))
        utils.set_running_lock(False)
        self.update_signal([("download-failed", (pkg_name, action_type, e))])

        self.exit_manager.check()

        if action_type == ACTION_UPGRADE:
            self.is_upgrading = False
Пример #4
0
    def download_failed(self, pkg_name, action_type, e):
        logger.error("%s download failed with %s" % (pkg_name, e))
        utils.set_running_lock(False)
        self.update_signal([("download-failed", (pkg_name, action_type, e))])
        
        self.exit_manager.check()    

        if action_type == ACTION_UPGRADE:
            self.is_upgrading = False
Пример #5
0
 def download_finish(self, action_id, action_type, all_pkg_names):
     utils.set_running_lock(False)
     self.update_signal([("download-finish", (action_id, action_type))])
     
     if action_type == ACTION_INSTALL:
         self.apt_action_pool.add_install_action(all_pkg_names)
     elif action_type == ACTION_UPGRADE:
         self.start_upgrade(all_pkg_names, action_id)
         
     self.exit_manager.check()
Пример #6
0
    def download_finish(self, action_id, action_type, all_pkg_names):
        utils.set_running_lock(False)
        self.update_signal([("download-finish", (action_id, action_type))])

        if action_type == ACTION_INSTALL:
            self.apt_action_pool.add_install_action(all_pkg_names)
        elif action_type == ACTION_UPGRADE:
            self.start_upgrade(all_pkg_names, action_id)
            self.is_upgrading = False

        self.exit_manager.check()
Пример #7
0
    def action_finish(self, signal_content):
        utils.set_running_lock(False)
        pkg_name, action_type, pkg_info_list = signal_content
        if action_type == ACTION_INSTALL:
            for pkg_info in pkg_info_list:
                self.pkg_cache.set_pkg_status(pkg_name, self.pkg_cache.PKG_STATUS_INSTALLED)
        elif action_type == ACTION_UPGRADE:
            for pkg_info in pkg_info_list:
                self.pkg_cache.set_pkg_status(pkg_name, self.pkg_cache.PKG_STATUS_UPGRADED)
        elif action_type == ACTION_UNINSTALL:
            for pkg_info in pkg_info_list:
                self.pkg_cache.set_pkg_status(pkg_name, self.pkg_cache.PKG_STATUS_UNINSTALLED)

        self.update_signal([("action-finish", signal_content)])
        self.exit_manager.check()
Пример #8
0
 def loop(self):
     signal = self.signal.get()
     if signal == "check":
         if self.is_download_action_running():
             print "Download action still runing, exit later"
             self.loop()
         elif self.is_update_list_running():
             print "Update list still runing, exit later"
             self.loop()
         elif self.is_apt_action_running():
             print "Apt action still running, exit later"
             self.loop()
         else:
             if self.have_exit_request():
                 print "Exit"
                 self.mainloop.quit()
                 utils.set_running_lock(False)
             else:
                 self.loop()
Пример #9
0
 def loop(self):
     signal = self.signal.get()
     if signal == "check":
         if self.is_download_action_running():
             logger.info("Download action still runing, exit later")
             self.loop()
         elif self.is_update_list_running():
             logger.info("Update list still runing, exit later")
             self.loop()
         elif self.is_apt_action_running():
             logger.info("Apt action still running, exit later")
             self.loop()
         else:
             if self.have_exit_request():
                 logger.info("backend service exit")
                 self.mainloop.quit()
                 utils.set_running_lock(False)
             else:
                 self.loop()
Пример #10
0
 def loop(self):
     signal = self.signal.get()
     if signal == "check":
         if self.is_download_action_running():
             logger.info("Download action still runing, exit later")
             self.loop()
         elif self.is_update_list_running():
             logger.info("Update list still runing, exit later")
             self.loop()
         elif self.is_apt_action_running():
             logger.info("Apt action still running, exit later")
             self.loop()
         else:
             if self.have_exit_request():
                 logger.info("backend service exit")
                 self.mainloop.quit()
                 utils.set_running_lock(False)
             else:
                 self.loop()
Пример #11
0
    def action_finish(self, signal_content):
        utils.set_running_lock(False)
        pkg_name, action_type, pkg_info_list = signal_content
        if action_type == ACTION_INSTALL:
            for pkg_info in pkg_info_list:
                self.pkg_cache.set_pkg_status(
                    pkg_name, self.pkg_cache.PKG_STATUS_INSTALLED)
        elif action_type == ACTION_UPGRADE:
            for pkg_info in pkg_info_list:
                self.pkg_cache.set_pkg_status(
                    pkg_name, self.pkg_cache.PKG_STATUS_UPGRADED)
        elif action_type == ACTION_UNINSTALL:
            for pkg_info in pkg_info_list:
                self.pkg_cache.set_pkg_status(
                    pkg_name, self.pkg_cache.PKG_STATUS_UNINSTALLED)

        self.update_signal([("action-finish", signal_content)])
        self.exit_manager.check()

        if signal_content[1] == ACTION_UPGRADE:
            self.is_upgrading = False
Пример #12
0
 def download_start(self, pkg_name, action_type):
     utils.set_running_lock(True)
     self.update_signal([("download-start", (pkg_name, action_type))])
Пример #13
0
 def action_start(self, signal_content):
     utils.set_running_lock(True)
     self.update_signal([("action-start", signal_content)])
     if signal_content[1] == ACTION_UPGRADE:
         self.is_upgrading = True
Пример #14
0
 def download_start(self, pkg_name, action_type):
     utils.set_running_lock(True)
     self.update_signal([("download-start", (pkg_name, action_type))])
     if action_type == ACTION_UPGRADE:
         self.is_upgrading = True
Пример #15
0
 def action_start(self, signal_content):
     utils.set_running_lock(True)
     self.update_signal([("action-start", signal_content)])
     if signal_content[1] == ACTION_UPGRADE:
         self.is_upgrading = True
Пример #16
0
 def download_failed(self, pkg_name, action_type, e):
     utils.set_running_lock(False)
     self.update_signal([("download-failed", (pkg_name, action_type, e))])
     
     self.exit_manager.check()    
Пример #17
0
 def download_start(self, pkg_name, action_type):
     utils.set_running_lock(True)
     self.update_signal([("download-start", (pkg_name, action_type))])
     if action_type == ACTION_UPGRADE:
         self.is_upgrading = True
Пример #18
0
 def action_failed(self, signal_content):
     utils.set_running_lock(False)
     self.update_signal([("action-failed", signal_content)])
     
     self.exit_manager.check()
Пример #19
0
 def action_start(self, signal_content):
     utils.set_running_lock(True)
     self.update_signal([("action-start", signal_content)])