[game-data-packager] 02/03: GOG: avoid duplicated code

Alexandre Detiste detiste-guest at moszumanska.debian.org
Thu Sep 17 06:13:36 UTC 2015


This is an automated email from the git hooks/post-receive script.

detiste-guest pushed a commit to branch master
in repository game-data-packager.

commit 840c877f4906d94f8d6369cc0fbd358c3d8904b1
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date:   Thu Sep 17 08:01:39 2015 +0200

    GOG: avoid duplicated code
---
 game_data_packager/__init__.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/game_data_packager/__init__.py b/game_data_packager/__init__.py
index 068ceb6..2f9a564 100644
--- a/game_data_packager/__init__.py
+++ b/game_data_packager/__init__.py
@@ -2683,6 +2683,7 @@ class GameData(object):
             packages = self.packages.values()
 
         possible = set()
+        possible_with_lgogdownloader = set()
 
         if self.cd_device is not None:
             rip_cd_packages = self.rip_cd_packages & packages
@@ -2709,6 +2710,7 @@ class GameData(object):
             elif gog_id and which('innoextract') and gog_id in GOG.owned_games():
                 logger.info('%s will be downloaded with lgogdownloader', package.name)
                 possible.add(package)
+                possible_with_lgogdownloader.add(package.name)
             else:
                 logger.debug('%s is impossible', package.name)
 
@@ -2839,14 +2841,14 @@ class GameData(object):
             if abort:
                 continue
 
+
             logger.debug('will produce %s', package.name)
             result = self.fill_gaps(package=package, download=download,
                     log=True)
-            gog_id = self.gog_download_name(package)
             if result is FillResult.COMPLETE:
                 ready.add(package)
-            elif (gog_id and which('innoextract') and
-                  gog_id in GOG.owned_games() and download):
+            elif download and package.name in possible_with_lgogdownloader:
+                gog_id = self.gog_download_name(package)
                 tmpdir = os.path.join(self.get_workdir(), gog_id)
                 mkdir_p(tmpdir)
                 try:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/game-data-packager.git



More information about the Pkg-games-commits mailing list