Example #1
0
    def finalise(self):
        # Deactivate the sync server first, so that we make sure it reverts
        # to the right backup file in case of problems.
        server = self.component_manager.current("sync_server")
        if server:
            server.deactivate()
        # Ditto for the web server.
        server = self.component_manager.current("web_server")
        if server:
            server.deactivate()
        # Saving the config should happen before we deactivate the plugins,
        # otherwise they are not restored upon reload.
        self.config().save()
        user_id = self.config()["user_id"]
        # We need to log before we unload the database.
        self.log().saved_database()
        self.log().stopped_program()
        # Now deactivate the database, such that deactivating plugins with
        # card types does not raise an error about card types in use.
        self.database().deactivate()
        self.component_manager.unregister(self.database())
        # Then do the review widget and other components.
        if self.review_widget():
            self.review_widget().deactivate()

        self.component_manager.deactivate_all()
        unregister_component_manager(user_id)
        if self.component_manager.debug_file:
            self.component_manager.debug_file.close()
Example #2
0
 def finalise(self):
     # Deactivate the sync server first, so that we make sure it reverts
     # to the right backup file in case of problems.
     server = self.component_manager.current("sync_server")
     if server:
         server.deactivate()
     # Ditto for the web server.
     server = self.component_manager.current("web_server")
     if server:
         server.deactivate()
     # Saving the config should happen before we deactivate the plugins,
     # otherwise they are not restored upon reload.
     self.config().save()
     user_id = self.config()["user_id"]
     # We need to log before we unload the database.
     self.log().saved_database()
     self.log().stopped_program()
     # Now deactivate the database, such that deactivating plugins with
     # card types does not raise an error about card types in use.
     self.database().deactivate()
     self.component_manager.unregister(self.database())
     # Then do the review widget and other components.
     self.review_widget().deactivate()
     self.component_manager.deactivate_all()
     unregister_component_manager(user_id)
     if self.component_manager.debug_file:
         self.component_manager.debug_file.close()
Example #3
0
 def finalise(self):
     # Saving the config should happen before we deactivate the plugins,
     # otherwise they are not restored upon reload.
     self.config().save()
     user_id = self.config()["user_id"]
     # We need to log before we unload the database.
     self.log().saved_database()
     self.log().stopped_program()
     # Now deactivate the database, such that deactivating plugins with
     # card types does not raise an error about card types in use.
     self.database().deactivate()
     self.component_manager.unregister(self.database())
     # Then do the other components.
     self.component_manager.deactivate_all()
     unregister_component_manager(user_id)