예제 #1
0
    def remove(self, from_library=False, from_disk=False):
        """Uninstall a game

        Params:
            from_library (bool): Completely remove the game from library, do
                                 not set it as uninstalled
            from_disk (bool): Delete the game files

        Return:
            bool: Updated value for from_library
        """
        if from_disk and self.runner:
            logger.debug("Removing game %s from disk", self.id)
            self.runner.remove_game_data(game_path=self.directory)

        # Do not keep multiple copies of the same game
        existing_games = pga.get_games_where(slug=self.slug)
        if len(existing_games) > 1:
            from_library = True

        if from_library:
            logger.debug("Removing game %s from library", self.id)
            pga.delete_game(self.id)
        else:
            pga.set_uninstalled(self.id)
        if self.config:
            self.config.remove()
        xdgshortcuts.remove_launcher(self.slug,
                                     self.id,
                                     desktop=True,
                                     menu=True)
        self.is_installed = False
        self.emit("game-removed")
        return from_library
예제 #2
0
 def remove(self, from_library=False, from_disk=False):
     if from_disk:
         self.runner.remove_game_data(game_path=self.directory)
     if from_library:
         pga.delete_game(self.slug)
         self.config.remove()
     else:
         pga.set_uninstalled(self.slug)
예제 #3
0
파일: game.py 프로젝트: jimmyleith/lutris
 def remove(self, from_library=False, from_disk=False):
     if from_disk:
         self.runner.remove_game_data(game_path=self.directory)
     if from_library:
         pga.delete_game(self.slug)
         self.config.remove()
     else:
         pga.set_uninstalled(self.slug)
예제 #4
0
 def remove(self, from_library=False, from_disk=False):
     if from_disk:
         if os.path.exists(self.directory):
             shutil.rmtree(self.directory)
     if from_library:
         pga.delete_game(self.slug)
     else:
         pga.set_uninstalled(self.slug)
     self.game_config.remove()
예제 #5
0
파일: game.py 프로젝트: Kehlyos/lutris
 def remove(self, from_library=False, from_disk=False):
     if from_disk:
         if os.path.exists(self.directory):
             shutil.rmtree(self.directory)
     if from_library:
         pga.delete_game(self.slug)
     else:
         pga.set_uninstalled(self.slug)
     self.config.remove()
예제 #6
0
 def remove(self, from_library=False, from_disk=False):
     if from_disk:
         self.runner.remove_game_data(game_path=self.directory)
     if from_library:
         pga.delete_game(self.slug)
         self.config.remove()
     else:
         pga.set_uninstalled(self.slug)
     shortcuts.remove_launcher(self.slug, desktop=True, menu=True)
예제 #7
0
파일: game.py 프로젝트: dacp17/lutris
 def remove(self, from_library=False, from_disk=False):
     if from_disk:
         logger.debug("Removing game %s from disk" % self.id)
         self.runner.remove_game_data(game_path=self.directory)
     if from_library:
         logger.debug("Removing game %s from library" % self.id)
         pga.delete_game(self.id)
     else:
         pga.set_uninstalled(self.id)
     self.config.remove()
     shortcuts.remove_launcher(self.slug, self.id, desktop=True, menu=True)
예제 #8
0
    def remove(self, from_library=False, from_disk=False):
        if from_disk and self.runner:
            logger.debug("Removing game %s from disk" % self.id)
            self.runner.remove_game_data(game_path=self.directory)

        # Do not keep multiple copies of the same game
        existing_games = pga.get_game_by_field(self.slug, 'slug', all=True)
        if len(existing_games) > 1:
            from_library = True

        if from_library:
            logger.debug("Removing game %s from library" % self.id)
            pga.delete_game(self.id)
        else:
            pga.set_uninstalled(self.id)
        self.config.remove()
        shortcuts.remove_launcher(self.slug, self.id, desktop=True, menu=True)
        return from_library
예제 #9
0
파일: game.py 프로젝트: Freso/lutris
    def remove(self, from_library=False, from_disk=False):
        if from_disk and self.runner:
            logger.debug("Removing game %s from disk" % self.id)
            self.runner.remove_game_data(game_path=self.directory)

        # Do not keep multiple copies of the same game
        existing_games = pga.get_game_by_field(self.slug, 'slug', all=True)
        if len(existing_games) > 1:
            from_library = True

        if from_library:
            logger.debug("Removing game %s from library" % self.id)
            pga.delete_game(self.id)
        else:
            pga.set_uninstalled(self.id)
        self.config.remove()
        shortcuts.remove_launcher(self.slug, self.id, desktop=True, menu=True)
        return from_library
예제 #10
0
파일: game.py 프로젝트: andrewschott/lutris
    def remove(self, from_library=False, from_disk=False):
        if from_disk and self.runner:
            logger.debug("Removing game %s from disk", self.id)
            self.runner.remove_game_data(game_path=self.directory)

        # Do not keep multiple copies of the same game
        existing_games = pga.get_games_where(slug=self.slug)
        if len(existing_games) > 1:
            from_library = True

        if from_library:
            logger.debug("Removing game %s from library", self.id)
            pga.delete_game(self.id)
        else:
            pga.set_uninstalled(self.id)
        if self.config:
            self.config.remove()
        xdgshortcuts.remove_launcher(self.slug, self.id, desktop=True, menu=True)
        self.is_installed = False
        self.emit("game-removed")
        return from_library
예제 #11
0
    def remove(self, from_library=False, from_disk=False):
        if from_disk and self.runner:
            logger.debug("Removing game %s from disk", self.id)
            self.runner.remove_game_data(game_path=self.directory)

        # Do not keep multiple copies of the same game
        existing_games = pga.get_games_where(slug=self.slug)
        if len(existing_games) > 1:
            from_library = True

        if from_library:
            logger.debug("Removing game %s from library", self.id)
            pga.delete_game(self.id)
        else:
            pga.set_uninstalled(self.id)
        if self.config:
            self.config.remove()
        xdgshortcuts.remove_launcher(self.slug, self.id, desktop=True, menu=True)
        self.is_installed = False
        self.emit("game-removed")
        return from_library
예제 #12
0
파일: test_pga.py 프로젝트: Yilnis/lutris-1
 def test_delete_game(self):
     pga.delete_game(self.game_id)
     game_list = pga.get_games()
     self.assertEqual(len(game_list), 0)
     self.game_id = pga.add_game(name="LutrisTest", runner="Linux")
예제 #13
0
파일: game.py 프로젝트: aoighost/lutris
 def remove(self, from_library=False, from_disk=False):
     if from_disk:
         shutil.rmtree(self.directory)
     if from_library:
         pga.delete_game(self.slug)
     self.game_config.remove()