コード例 #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
ファイル: game.py プロジェクト: roberttomsons/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.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
ファイル: game.py プロジェクト: regoecuaycong/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)
     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